Firebase functions : Cannot set property config of #<Object> which has only a getter

Viewed 5281

Firebase functions was working fine I updated to latest firebase-tools Now running into this error issue when running firebase serve.

[debug] [2020-05-28T20:37:11.387Z] [runtime-status] [93658] Error in handleMessage:  => TypeError: Cannot set property config of #<Object> which has only a getter: TypeError: Cannot set property config of #<Object> which has only a getter
    at {....}/node/v10.15.0/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:455:19
    at Generator.next (<anonymous>)
    at fulfilled ({....}/node/v10.15.0/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:5:58)
[warn] ⚠  functions: Cannot set property config of #<Object> which has only a getter {"metadata":{"emulator":{"name":"functions"},"message":"Cannot set property config of #<Object> which has only a getter"}}
[warn] ⚠  Your function was killed because it raised an unhandled error. {"metadata":{"emulator":{"name":"functions"},"message":"Your function was killed because it raised an unhandled error."}}
4 Answers

I just got the same error when trying to firebase serve. The fix for me was simply to update my firebase-tools to the latest version with npm install -g firebase-tools. The newest update appears to have solved this particular problem.

edit: The fix was released in version 8.4.1 of firebase-tools

  1. Check you firebase-debug.log for the firebase-tools version. The bug was fixed in firebase-tools: 8.4.1.

    [debug] [2020-10-08T09:42:11.364Z] CLI Version: 8.8.1

  2. Upgrade the global firebase cli

    npm i -g firebase-cli@8.12.0

  3. Check your package.json for the firebase-cli version and if lower than 8.4.1 upgrade it as well.

    npm i firebase-cli@8.12.0

  4. Run firebase emulators:start and check again the firebase-debug.log for the cli version. It should be higher then 8.4.1

    [debug] [2020-10-08T09:42:11.364Z] CLI Version: 8.8.1

Just update firebase-functions to 3.6.0

With NPM: npm i firebase-functions@3.6.0

With yarn: yarn add firebase-functions@3.6.0

Related