【问题标题】:Why will firebase CLI say deploy complete and not deploy a function?为什么 firebase CLI 会说部署完成而不部署功能?
【发布时间】:2021-06-15 10:13:17
【问题描述】:

我正在使用 firebase-tools CLI 部署 firebase 功能。我正在尝试使用firebase deploy --only functions:functionName 部署一个函数。

这是在现有项目中。函数位于/functions/index.js

直到几个小时前,部署工作正常。但是现在在尝试部署新功能时,我得到以下信息:

i  deploying functions
i  functions: ensuring required API cloudfunctions.googleapis.com is enabled...
i  functions: ensuring required API cloudbuild.googleapis.com is enabled...
+  functions: required API cloudbuild.googleapis.com is enabled
+  functions: required API cloudfunctions.googleapis.com is enabled
i  functions: preparing functions directory for uploading...

+  Deploy complete!

但它显然甚至没有上传任何内容或部署功能。尝试部署现有功能,我得到The following functions are found in your project but do not exist in your local source code:

我有点困惑这似乎是如何“坏掉”的。即使查看项目的 git,除了编写一个新函数外,任何配置文件或任何内容都没有更改。自上次部署以来,我没有更新任何包,并尝试了以前版本的firebase-tools 以及最新版本。

以相同的方式将不同的功能部署到不同的项目是成功的。

【问题讨论】:

    标签: firebase google-cloud-functions firebase-tools


    【解决方案1】:

    事实证明,我在项目根目录(不是 /functions 目录)中创建了一个名为 functions.js 的文件,看起来 firebase-tools 正在寻找该(空)文件的函数,而不是函数目录。奇怪,而且没有任何错误消息,因为我猜它认为它正在寻找的文件确实存在。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-01-14
      • 2021-07-16
      • 1970-01-01
      • 1970-01-01
      • 2020-07-30
      • 1970-01-01
      • 2019-07-04
      • 2020-08-02
      相关资源
      最近更新 更多