从VS Code集成终端我运行firebase serve --only functions,hosting
然后在我创建的默认launch.json调试选项卡:功能调试
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${file}"
}
]
}
我要调试的服务器侧(功能/ index.js)而不是客户端。
我试过https://code.visualstudio.com/docs/nodejs/nodejs-debugging一些配置没有运气。
如何调试VS代码中的Firebase函数?
通过单元测试进行调试可能是您现在的最佳选择:https://firebase.google.com/docs/functions/unit-testing –
不是首选选项,但是如果是唯一的工作,我会与。 –