Have tried with firebase-admin 8.8.0, 8.7.0, and 8.6.1 (the last 3 versions)
Running firebase-functions 3.3.0
I'm getting this error when I try to deploy Cloud Functions. firebase deploy --only functions:FUNCTIONNAME
Any idea what the problem is? Anyone else have this issue?
Error: Error occurred while parsing your function triggers.
TypeError: instance.INTERNAL.registerComponent is not a function
at registerDatabase (/PATH/cloud-functions/functions/node_modules/firebase-admin/node_modules/@firebase/database/dist/index.node.cjs.js:15165:39)
at Object.<anonymous> (/PATH/cloud-functions/functions/node_modules/firebase-admin/node_modules/@firebase/database/dist/index.node.cjs.js:15196:5)
at Module._compile (internal/modules/cjs/loader.js:721:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:732:10)
at Module.load (internal/modules/cjs/loader.js:620:32)
at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
at Function.Module._load (internal/modules/cjs/loader.js:552:3)
at Module.require (internal/modules/cjs/loader.js:657:17)
at require (internal/modules/cjs/helpers.js:22:18)
at FirebaseNamespace.get [as database] (/PATH/cloud-functions/functions/node_modules/firebase-admin/lib/firebase-namespace.js:282:38)
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
Duplicate of #717, #714
I followed the linked threads but no concrete solutions were provided.
@firebase/app should be updated in @firebase/app/package.json?
it's work fo me. Thank alot
More clearly
npm install @firebase/app --save
was the solution
If it helps anyone see my comment here: https://github.com/firebase/firebase-admin-node/issues/714#issuecomment-567877071
@firebase/app should not be explicitly required on server side when firebase-admin is included but you have to be careful @firebase/app isn't somewhere in your node_modules folder hierarchy.
It's possible that @firebase/app is expected to be in your node_modules, like if you're using @firebase/testing:
PS C:\code\> npm ls @firebase/app
[email protected] C:\code
`-- @firebase/[email protected]
`-- [email protected]
`-- @firebase/[email protected]
In my case, the fix was updating @firebase/testing from version 0.13 to 0.16.
In my case, I already had @firebase/app as part of firebase. I also have node 12 installed with Win 10
npm ls @firebase/app
functions@ C:\Users\me\source\repos\admin\functions
`-- [email protected]
`-- @firebase/[email protected]
I fixed the issue by updating the firebase dependencies to the latest.
npm i --save firebase@latest firebase-admin@latest firebase-functions@latest
From my package.json:
"firebase": "^8.2.4",
"firebase-admin": "^9.4.2",
"firebase-functions": "^3.13.1",
Note: Always update firebase-tool to the latest:
npm i -g firebase-tools@lates
Most helpful comment
More clearly
npm install @firebase/app --savewas the solution