firebase-tools: Cannot set property config of # which has only a getter

[REQUIRED] Environment info

firebase-tools: 8.4.0

Platform: Windows

[REQUIRED] Test case

index.js

const functions = require('firebase-functions');
const admin = require('firebase-admin');
admin.initializeApp();

exports.testFunction = functions.https.onRequest(async (req, res) => {

  console.log(req.body);

});

[REQUIRED] Steps to reproduce

the initial emulate worked fine the initial and subsequent deploys work fine the function works fine in production not able to emulate locally anymore.

Console output:

i  emulators: Starting emulators: functions
+  functions: Using node@10 from host.
i  functions: Watching "D:\path\to\functions" for Cloud Functions...
!  functions: Cannot set property config of #<Object> which has only a getter
!  Your function was killed because it raised an unhandled error.

In addition to this issue, it is not clear from output what happened. Nothing in debug logs.

[REQUIRED] Expected behavior

Emulator starts

[REQUIRED] Actual behavior

Emulator fails to start

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 35
  • Comments: 35 (7 by maintainers)

Most upvoted comments

The fix was just released in version 8.4.1 of firebase-tools

Hello guys,

The first check which version you’ve installed mine was 8.1.1 Please update firebase-tools by calling

sudo npm i -g firebase-tools

This will install latest version 8.4.1 And It fixed my issue. In fact, I have installed the latest firebase function and admin “firebase-admin”: “8.12.1”, “firebase-functions”: “3.6.1”,

I hope you’ve fixed the issue.

Maybe this is helpful to somebody: My linux was using “/usr/local/lib/node_modules/firebase-tools/lib/bin/firebase.js” anytime I typed “firebase” in the console, so it was using the 7.12.0 version of the package. I changed the symbolic link, and now I’m sure that I’m using the 8.6.0 version.

user@machine: which firebase
/usr/local/bin/firebase
user@machine: cd /usr/local/bin
user@machine: sudo rm firebase
user@machine: sudo ln -s /usr/lib/node_modules/firebase-tools/lib/bin/firebase.js firebase
user@machine: firebase --version
8.6.0

The word local is the key

In case it helps anyone: I had to use the explicit version to upgrade the tools and then the problem went away: sudo npm i -g firebase-tools@8.4.1

@jakubjodelka can you try clearing your node_modules folder and running npm install again? If this keeps happening for you after that and with firebase --version showing 8.4.1 let me know.

Looks like this is an issue with v8.x.x. Downgrading to v7.16.2 works.

In case it helps, I had conflict between my global npm firebase-tools@7.0.0 and my global yarn firebase-tools@8.6.0. Deleting my global npm version fixed my issue of returning 7.0.0 from firebase -V

Hi guys,

I’ve received this error after an update in the firebase-functions package (3.6.2).

In my case, the solution was to delete /node_modules and downgrade the firebase-functions to the previous version (npm install --save firebase-functions@3.6.1).

@samtstern ^ Not sure if this issue should be closed.

Running into the exact same issue. macOS

I have a feeling this may be related to today’s firebase-functions release: https://github.com/firebase/firebase-functions/releases/tag/v3.6.2