【问题标题】:I can't deploy my function on firebse, app(us-central1) fail我无法在 firebase 上部署我的功能,app(us-central1) 失败
【发布时间】:2021-09-18 10:30:54
【问题描述】:
Function URL (app(us-central1)): https://us-central1-yisus-portfolio.cloudfunctions.net/app

Functions deploy had errors with the following functions:
        app(us-central1)

To try redeploying those functions, run:
    firebase deploy --only "functions:app"

To continue deploying other features (such as database), run:
    firebase deploy --except functions

Error: Functions did not deploy properly.

是一个在 express 上创建的服务器,它发送 HTML JS 和 CSS,但使用服务器端渲染,当我部署另一个应用程序结束之前执行时,它可以工作。 文档说该函数的执行时间不能超过 60 秒,并且在函数的日志中说这需要 13000 (我猜是毫秒),但我不确定是否是这样,或者是否是我做的错误。

但是 当我运行firebase --serve --only functions, hosting 它可以工作,但是当我部署时没有

{
  "hosting": {
    "public": "public",
    "rewrites": [ {
        "source": "**",
        "function": "app"
      } ],
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ]
  }
}

firebase.json

const functions = require("firebase-functions");
const { app } = require("./lib/server")
exports.app = functions.https.onRequest(app);

功能索引

【问题讨论】:

  • 请尝试使用 --debug 标志 (firebase deploy --only "functions:app" --debug) 运行部署命令,看看是否有任何错误日志可以从中挑选出来。

标签: node.js firebase express google-cloud-functions server-side-rendering


【解决方案1】:

Google Cloud Status Dashboard 现在右上角有这个横幅:

us-central1 和 europe-west1 中的 Cloud Functions 部署失败

所以我认为这也是您看到的错误消息的原因。我建议检查状态页面以获取更新。

【讨论】:

    猜你喜欢
    • 2021-12-29
    • 1970-01-01
    • 2019-01-17
    • 2020-05-23
    • 2020-11-13
    • 2020-08-06
    • 2017-11-15
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多