Firebase 模拟器被忽略的功能故障排除

Troubleshooting ignored functions for Firebase emulator

我正在根据此处的文档启动我的云函数模拟器:

firebase emulators:start --only functions

onRequest 函数看起来很顺利:

i  Starting emulators: ["functions"]
⚠  Your requested "node" version "8" doesn't match your global version "10"
✔  functions: Emulator started at http://localhost:5001
i  functions: Watching "/Users/.../functions" for Cloud Functions...
i  functions: HTTP trigger initialized at http://localhost:5001/sweever-prod/us-central1/sendMailTrigger
i  functions: HTTP trigger initialized at http://localhost:5001/sweever-prod/us-central1/sitemapData

但是当有 onTrigger 函数时会变得平淡:

Ignoring trigger "newUserSignedUp" because the Cloud Firestore emulator is not running.
Ignoring trigger "newItemAdded" because the Cloud Firestore emulator is not running.
Ignoring trigger "itemUpdated" because the Cloud Firestore emulator is not running.

onTrigger 函数在本地被忽略的原因可能是什么?鉴于文档的参考,我相信 Firestore 可以 在本地处理这些问题:"Cloud Functions emulator which can emulate the following function types: ... Cloud Firestore functions." 我认为 onTrigger 将是 Cloud Firestore 函数,但可能会混淆术语。

如果您想 运行 多个产品(Hosting 和 Firestore)的模拟器,您应该使用以下命令启动模拟器:

firebase emulators:start

现在,您只是为不涉及 Firestore 的功能启动模拟器。详情请参考documentation