Error in Cloud Function in firebase The argument 'id' must be a non-empty string

Viewed 2433

I am deploy a API GRAPHQL

When execute firebase serve or firebase deploy i give this error TypeError [ERR_INVALID_ARG_VALUE]: The argument 'id' must be a non-empty string. Received ''

I using this repo to guide me

This is my config

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"
  }
}

Any knows why happend this, thanks

3 Answers

In my case, this error has popped because of missing "grpc" dependency. After I have installed it, it works. Sadly, it's not documented anywhere.

Firbase SDK is depending on grpc node package (ref). This error occurs once you have upgraded firebase admin.

I fixed this error by installing grpc

npm install grpc

I have faced that issue today, and I found that my import statemen was something like this import ''; I was importing an empty string..

Related