4

Just updated firebase-tools to 8.4.0 and now getting the following error when running firebase emulators:start:

⚠ TypeError: Cannot convert object to primitive value at Proxy. (/Users/USER/.nvm/versions/node/v13.5.0/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:311:83)

Please let me know of any additional info needed!

user2521295
  • 823
  • 2
  • 12
  • 23
  • 1
    This is a bug on firebase-tools, which according to [this comment](https://github.com/firebase/firebase-tools/issues/2273#issuecomment-632518009) has been introduced in 8.3.0. This same comment suggests downgrading to 8.2.0 – Rosário Pereira Fernandes May 23 '20 at 00:34
  • I've noticed you're running this on node 13. If you don't mind, could please try running it on node 10? – Rosário Pereira Fernandes May 23 '20 at 00:53
  • 1
    Yes, had wanted to upgrade to use the UI. I tried running on node 10.20.1 and still get: TypeError: Cannot convert object to primitive value at Proxy. (/Users/USER/.nvm/versions/node/v10.20.1/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:311:83) – user2521295 May 25 '20 at 15:38
  • can you show how you're calling `admin.initializeApp()` on your functions/index.js ? – Rosário Pereira Fernandes May 25 '20 at 15:44
  • 1
    The latest [comment](https://github.com/firebase/firebase-tools/issues/2273#issuecomment-634056715) on the issue referenced by @RosárioPereiraFernandes says _In general nobody should be using initializeApp(functions.config().firebase) anymore. The plain initializeApp() is preferred._ – fulv May 26 '20 at 15:33

2 Answers2

2

The latest comment on the issue referenced by @RosárioPereiraFernandes says:

In general nobody should be using initializeApp(functions.config().firebase) anymore. The plain initializeApp() is preferred.

I can attest that calling initializeAdd() without passing any arguments allows the emulator to start properly.

fulv
  • 1,016
  • 1
  • 9
  • 18
  • Meanwhile, 8.4.1 has been released: https://github.com/firebase/firebase-tools/releases/tag/v8.4.1 – fulv May 29 '20 at 03:16
1

It's a regression in 8.3.0 and 8.4.0. For now downgrade to 8.2.0

npm i -g firebase-tools@8.2.0
tomrozb
  • 25,773
  • 31
  • 101
  • 122