【问题标题】:Firebase Cloud Functions - Functions that has been deleted from code, aren't being deleted from CFFirebase Cloud Functions - 已从代码中删除的函数,不会从 CF 中删除
【发布时间】:2018-11-12 17:34:22
【问题描述】:

问题

当我从云函数中删除一个函数并重新部署其余函数时,我在终端中收到一条消息:

The following functions are found in your project but do not exist in your 
local source code:
        function1(us-central1)
        function2(us-central1)
Would you like to proceed with deletion? Selecting no will continue the rest of the deployments. (y/N)

我输入“y”。一旦我再次重新部署,我会一遍又一遍地收到相同的消息。我错过了什么?

依赖项

"firebase-admin": "~6.0.0",
"firebase-functions": "^2.1.0",

【问题讨论】:

  • 如果 Firebase CLI 的某些内容无法按您预期的方式运行,请提交一份错误报告,其中包含任何人都可以采取的重现问题的步骤。确保您拥有最新版本的 firebase-toolsfirebase.google.com/support/contact/bugs-features

标签: node.js typescript google-cloud-functions


【解决方案1】:

原来这是最近报告的一个已知问题。

为了解决这个问题,我引用 Firebase 的支持:

很抱歉给您带来不便,这是最近报告的一个已知问题,请查看此链接:https://github.com/firebase/firebase-tools/issues/982。该修复程序已准备就绪,应该在 firebase-tools 软件包的下一个版本中可用。同时有两种选择:

  • 添加“--force”选项: firebase deploy --force --only functions

  • 使用“删除”命令: firebase functions:delete funcName1 functName2 ...

您可以像这样检查更多选项:

  • firebase 部署 --help

  • firebase 函数:删除 --help

警告!根据 firebase-tools 版本--force 可能会删除所有其他功能。记得提前测试。

【讨论】:

    最近更新 更多