Firebase Serve 命令失败,出现错误 404

Firebase Serve command failing with error 404

每当我 运行 firebase 在我的 mac 上服务时,我都会收到 404 错误...这以前从未发生过,我只是在开始前 5 分钟使用本地开发服务器发生。我删除了 firebase.json 文件并重新初始化它,重新安装了 firebase 工具,但每次都失败。以下是 运行 在调试模式下执行命令的结果。

    firebase serve --debug
[2018-09-11T16:12:25.873Z] ----------------------------------------------------------------------
[2018-09-11T16:12:25.876Z] Command:       /usr/local/bin/node /usr/local/bin/firebase serve --debug
[2018-09-11T16:12:25.877Z] CLI Version:   4.2.1
[2018-09-11T16:12:25.877Z] Platform:      darwin
[2018-09-11T16:12:25.877Z] Node Version:  v6.11.3
[2018-09-11T16:12:25.878Z] Time:          Tue Sep 11 2018 11:12:25 GMT-0500 (CDT)
[2018-09-11T16:12:25.878Z] ----------------------------------------------------------------------

[2018-09-11T16:12:25.890Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[2018-09-11T16:12:25.890Z] > authorizing via signed-in user
[2018-09-11T16:12:25.893Z] >>> HTTP REQUEST GET https://admin.firebase.com/v1/projects/skadaddle-10f24  

[2018-09-11T16:12:26.210Z] <<< HTTP RESPONSE 200 server=nginx, date=Tue, 11 Sep 2018 16:12:26 GMT, content-type=application/json; charset=utf-8, content-length=114, connection=close, x-content-type-options=nosniff, strict-transport-security=max-age=31536000; includeSubdomains, cache-control=no-cache, no-store
[2018-09-11T16:12:26.212Z] >>> HTTP REQUEST GET https://cloudresourcemanager.googleapis.com/v1/projects/skadaddle-10f24  

[2018-09-11T16:12:26.385Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Tue, 11 Sep 2018 16:12:26 GMT, server=ESF, cache-control=private, x-xss-protection=1; mode=block, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="44,43,39,35", accept-ranges=none, connection=close

=== Serving from '/Users/Kevin/Desktop/Source/Skadaddle'...

[2018-09-11T16:12:26.388Z] >>> HTTP REQUEST GET https://mobilesdk-pa.googleapis.com/v1/projects/255074367563/clients/_:getWebAppConfig  

[2018-09-11T16:12:26.514Z] <<< HTTP RESPONSE 404 vary=X-Origin, Referer, Origin,Accept-Encoding, content-type=application/json; charset=UTF-8, date=Tue, 11 Sep 2018 16:12:26 GMT, server=ESF, cache-control=private, x-xss-protection=1; mode=block, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="44,43,39,35", accept-ranges=none, connection=close
[2018-09-11T16:12:26.514Z] <<< HTTP RESPONSE BODY code=404, message=Requested entity was not found., status=NOT_FOUND

Error: HTTP Error: 404, Requested entity was not found.
[2018-09-11T16:12:26.519Z] Error Context: {
  "body": {
    "error": {
      "code": 404,
      "message": "Requested entity was not found.",
      "status": "NOT_FOUND"
    }
  },
  "response": {
    "statusCode": 404,
    "body": {
      "error": {
        "code": 404,
        "message": "Requested entity was not found.",
        "status": "NOT_FOUND"
      }
    },
    "headers": {
      "vary": "X-Origin, Referer, Origin,Accept-Encoding",
      "content-type": "application/json; charset=UTF-8",
      "date": "Tue, 11 Sep 2018 16:12:26 GMT",
      "server": "ESF",
      "cache-control": "private",
      "x-xss-protection": "1; mode=block",
      "x-frame-options": "SAMEORIGIN",
      "x-content-type-options": "nosniff",
      "alt-svc": "quic=\":443\"; ma=2592000; v=\"44,43,39,35\"",
      "accept-ranges": "none",
      "connection": "close"
    },
    "request": {
      "uri": {
        "protocol": "https:",
        "slashes": true,
        "auth": null,
        "host": "mobilesdk-pa.googleapis.com",
        "port": 443,
        "hostname": "mobilesdk-pa.googleapis.com",
        "hash": null,
        "search": null,
        "query": null,
        "pathname": "/v1/projects/255074367563/clients/_:getWebAppConfig",
        "path": "/v1/projects/255074367563/clients/_:getWebAppConfig",
        "href": "https://mobilesdk-pa.googleapis.com/v1/projects/255074367563/clients/_:getWebAppConfig"
      },
      "method": "GET"
    }
  }
}

这里是 Firebase 员工

CLI 部署存在一个已知问题。正在调查中。您可以在此处跟踪中断情况:

https://status.firebase.google.com/incident/Hosting/18015

每当您遇到这样的 CLI 故障时,请直接联系 Firebase 支持,并提供所有相关详细信息:

https://firebase.google.com/support/

问题出在 Google。当您 运行 firebase serve 时,它向 https://mobilesdk-pa.googleapis.com 发出请求,该请求当前抛出 404 错误。

我可以通过编辑 node_modules/firebase-tools/lib 中的 3 个文件来解决这个问题(临时修复)。

api.js 的第 99 行是错误的 URL 被调用的地方。只需将其更改为任何有效的非 404ing url.

然后,在fetchWebSetup.js中,将第9行"GET"后的参数改为空字符串(如return api.request("GET", "", {

对第 51 行的 functionsConfig.js 执行与上述相同的操作。

这应该可以让您暂时 运行 休息,但是当 Google 修复 URL.

时,这应该会自行解决

我只能通过删除 .firebaserc 然后再删除 运行 firebase init 来解决这个问题。仅确保您不会错误地覆盖现有配置。