【发布时间】:2019-08-20 15:11:39
【问题描述】:
我有一个由 auth.user().onCreate 触发的 Firebase 函数 createUser。
每当我在本地提供功能时,它都会被忽略。
当我运行 firebase serve、firebase serve -only functions,firestore、firebase emulators:start 或 firebase emulators:start --only functions,firestore 时,我得到相同的输出:
⚠ functions: Your GOOGLE_APPLICATION_CREDENTIALS environment variable points to /home/david/Sync/alikely/key.json. Non-emulated services will access production using these credentials. Be careful!
✔ functions[createItem]: http function initialized (http://localhost:5000/alikely-ce1d5/us-central1/createItem).
i functions[createUser]: function ignored because the firebaseauth.googleapis.com emulator does not exist or is not running.
如上所示,我已尝试按照说明在此处设置管理员凭据:https://firebase.google.com/docs/functions/local-emulator。
我已经使用firebase init 初始化了函数和firestore,我的项目目录包含firestore.rules、firestore.indexes.json 和firebase.json。这些文件之一的内容应该受到责备吗?
如何在本地模拟我的所有功能以实现完整的本地开发?如何启用“firebaseauth.googleapis.com 模拟器”?
【问题讨论】:
标签: firebase triggers google-cloud-firestore google-cloud-functions