简体   繁体   English

解决Firebase模拟器的忽略功能

[英]Troubleshooting ignored functions for Firebase emulator

I'm starting my cloud function emulator according to the documentation here: 我正在根据此处的文档启动我的云功能仿真器:

firebase emulators:start --only functions

Things look smooth for the onRequest 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

but falls flat when there are onTrigger functions: 但是在使用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.

What might the cause of onTrigger functions being ignored locally? onTrigger函数在本地被忽略的原因是什么? I'm led to believe Firestore can handle these locally given the documentation's reference: "Cloud Functions emulator which can emulate the following function types: ... Cloud Firestore functions." 根据文档参考,我被认为Firestore 可以在本地处理这些问题:“可以模拟以下功能类型的Cloud Functions仿真器:... Cloud Firestore函数。” I think the onTrigger would be a Cloud Firestore function but might be confusing the terminology. 我认为onTrigger将是Cloud Firestore函数,但可能会混淆术语。

If you want to run the emulators for multiple products (Hosting and Firestore), you should be starting the emulator with the command: 如果要为多个产品(主机和Firestore)运行仿真器,则应使用以下命令启动仿真器:

firebase emulators:start

Right now, you are just starting the emulator for functions that don't involve Firestore. 现在,您只是为不涉及Firestore的功能启动模拟器。 Please refer to the documentation for more information. 请参阅文档以获取更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM