【发布时间】:2019-10-06 11:54:09
【问题描述】:
我正在尝试在本地窗口上调试 firebase 功能
如https://medium.com/@mwebler/debugging-firebase-functions-with-vs-code-3afab528bb36中所述
我愿意
set FIREBASE_CONFIG={ databaseURL: 'https://invoice-manager-251609.firebaseio.com', storageBucket: 'invoice-manager-251609.appspot.com', projectId: 'invoice-manager-251609'}
functions start
得到
┌────────┬────────┬─────────┬─────────────────────────────────────────────────────────────────┐
│ Status │ Name │ Trigger │ Resource │
├────────┼────────┼─────────┼─────────────────────────────────────────────────────────────────┤
│ FAILED │ upload │ HTTP │ http://localhost:8010/invoice-manager-251609/us-central1/upload │
├────────┼────────┼─────────┼─────────────────────────────────────────────────────────────────┤
│ FAILED │ tst │ HTTP │ http://localhost:8010/invoice-manager-251609/us-central1/tst │
├────────┼────────┼─────────┼─────────────────────────────────────────────────────────────────┤
│ FAILED │ tst1 │ HTTP │ http://localhost:8010/invoice-manager-251609/us-central1/tst1 │
└────────┴────────┴─────────┴─────────────────────────────────────────────────────────────────┘
如果我这样做
firebase emulators:start
我明白了
undefinedWarning,根据 GCLOUD_PROJECT 估计 Firebase 配置。
初始化 firebase-admin 可能会失败[2019-10-06T11:44:51.932Z] @firebase/database:FIREBASE 致命错误:无法解析 Firebase 网址。
请使用 https://.firebaseio.com
我也试过了:
functions debug tst1
得到:
错误:函数工作者崩溃并退出代码:9 未定义(节点:21096)[DEP0062] 弃用警告:`node --debug
和
node --debug-brk
are invalid. Please usenode --inspectornode --inspect-brk` 代替。
我试过node-10and node-8
我也试过这个: https://medium.com/@david_mccoy/build-and-debug-firebase-functions-in-vscode-73efb76166cf
还有这个 https://rominirani.com/google-cloud-functions-tutorial-debugging-local-functions-357c24829198
我遇到同样的错误
怎么了?
如何在本地窗口上调试 firebase?
【问题讨论】:
-
我不相信当前的 Firebase 模拟器套件支持调试功能。那个教程有点老了。如果您在使用模拟器时遇到问题,请在 GitHub 上发布问题。 github.com/firebase/firebase-tools
-
这是不正确的:我能够通过 devTool 逐步调试在我的本地窗口上使用 Firebase 模拟器调试功能
标签: firebase google-cloud-functions firebase-tools