【问题标题】:Error in Cloud Function in firebase The argument 'id' must be a non-empty stringfirebase 中的云函数错误参数“id”必须是非空字符串
【发布时间】:2019-06-19 22:45:54
【问题描述】:

我正在部署一个 API GRAPHQL

当执行firebase servefirebase deploy 时,我给出了这个错误TypeError [ERR_INVALID_ARG_VALUE]:参数'id' 必须是一个非空字符串。收到''

I using this repo to guide me

这是我的配置

firebase.json

{
  "functions": {
    "predeploy": ["npm --prefix \"$RESOURCE_DIR\" run lint"],
    "source": "."
  },
  "hosting": {
    "public": "public",
    "ignore": ["firebase.json", "**/.*", "**/node_modules/**"]
  }
}

package.json

{
  "name": "api-gql-firebase",
  "version": "1.0.0",
  "description": "",
  "main": "dist/functions.js",
  "engines": {
    "node": "10"
  },
  "scripts": {
    "watch": "parcel src/functions.js --target node",
    "build": "parcel build src/functions.js --target node --detailed- 
    report",
    "serve": "firebase serve --only functions",
    "emulator": "firebase emulators:start --only functions",
    "shell": "firebase functions:shell",
    "start": "npm run shell",
    "predeploy": "npm run build",
    "deploy": "firebase deploy --only functions",
    "logs": "firebase functions:log"
  },
  "repository": {
    "type": "git",
    "url": "git@gitlab.com:code-training/nodejs/api-gql-firebase.git"
  },
  "dependencies": {
    "apollo-server-express": "^2.6.3",
    "express": "^4.17.1",
    "firebase-admin": "^8.2.0",
    "firebase-functions": "^3.0.1",
    "graphql": "^14.3.1"
  },
  "devDependencies": {
    "firebase-functions-test": "^0.1.6",
    "parcel-bundler": "^1.12.3"
  }
}

谁知道为什么会这样,谢谢

【问题讨论】:

  • 您没有显示任何会导致此问题的代码。你现在拥有的只是配置。

标签: firebase deployment google-cloud-functions


【解决方案1】:

在我的情况下,由于缺少“grpc”依赖项而弹出此错误。在我安装它之后,它就可以工作了。遗憾的是,它没有记录在任何地方。

【讨论】:

    【解决方案2】:

    Firbase SDK 依赖于 grpc 节点包 (ref)。一旦您升级了 Firebase 管理员,就会出现此错误。

    我通过安装 grpc 修复了这个错误

    npm 安装 grpc

    【讨论】:

      【解决方案3】:

      我今天遇到了这个问题,我发现我的导入声明是这样的 import ''; 我正在导入一个空字符串..

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2022-09-27
        • 2020-09-14
        • 2020-12-01
        • 1970-01-01
        • 1970-01-01
        • 2019-04-26
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多