firebase参数中的Cloud函数出错';id';必须是非空字符串

firebase参数中的Cloud函数出错';id';必须是非空字符串,firebase,deployment,google-cloud-functions,Firebase,Deployment,Google Cloud Functions,我正在部署一个API GRAPHQL 执行firebase-service或firebase-deploy时,我给出此错误TypeError[ERR\u INVALID\u ARG\u VALUE]:参数“id”必须是非空字符串。收到“” 这是我的配置 firebase.json { "functions": { "predeploy": ["npm --prefix \"$RESOURCE_DIR\" run lint"], "source": "." }, "h

我正在部署一个API GRAPHQL

执行
firebase-service
firebase-deploy
时,我给出此错误TypeError[ERR\u INVALID\u ARG\u VALUE]:参数“id”必须是非空字符串。收到“”

这是我的配置

firebase.json

{
  "functions": {
    "predeploy": ["npm --prefix \"$RESOURCE_DIR\" run lint"],
    "source": "."
  },
  "hosting": {
    "public": "public",
    "ignore": ["firebase.json", "**/.*", "**/node_modules/**"]
  }
}
{
  "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"
  }
}
package.json

{
  "functions": {
    "predeploy": ["npm --prefix \"$RESOURCE_DIR\" run lint"],
    "source": "."
  },
  "hosting": {
    "public": "public",
    "ignore": ["firebase.json", "**/.*", "**/node_modules/**"]
  }
}
{
  "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"
  }
}

任何人都知道为什么会发生这种情况,谢谢

在我的例子中,这个错误是因为缺少“grpc”依赖项而出现的。我安装好之后,它就可以工作了。遗憾的是,它没有任何文档记录。

Firbase SDK依赖于
grpc
node包()。升级firebase admin后会发生此错误

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

npm安装grpc


我今天面对了这个问题,我发现我的进口国是这样的
import'我正在导入一个空字符串。

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