The library became unusable since 7.5.1 on an existing Ionic 3 project. Typescript is at 2.8.4.


I found a few problems with this issue:
Same error message here also since 7.5.1 on Ubuntu 19.10, Node v12.13.1, TypeScript 3.7.3.
How did you upgrade firebase? It seems that you upgraded @firebase/app, but not @firebase/database. What other dependencies do you have?
@Feiyang1 same as always - npm i firebase.
The project also has firebase-admin installed as a dev. dependency, used in certain helper scripts on the command line.
Ah I see. I think firebase-admin and firebase are pulling in 2 different versions of @firebase/database. Can you please do a clean install, so both are pulling in the latest version?
Thanks for the tip @Feiyang1, uninstalling and installing both resolved the issue. I supposed NPM had messed up something in the lock file. I'm closing this now.
Unlinke @zarko-tg I have a _firestore_ error:
function configureForFirebase(firebase) {
firebase.INTERNAL.registerService('firestore', function (app) { return new Firestore(app); }, shallowCopy(firestoreNamespace));
}
鈥ut I'm using an experimental build of firestore to get offline persistence in web workers. It may be incompatible with the new firebase versions, I'm going to ask @thebrianchen if he can update the build.
@laurentpayot Yep. That should solve your problem.
Yep. Problem solved. Thanks!
Getting the same error as well:
index.esm.js?2e66:3469 Uncaught TypeError: instance.INTERNAL.registerService is not a function
at registerStorage
function registerStorage(instance) {
var namespaceExports = {
// no-inline
TaskState: TaskState,
TaskEvent: TaskEvent,
StringFormat: StringFormat,
Storage: Service,
Reference: Reference
};
instance.INTERNAL.registerService(STORAGE_TYPE, factory, namespaceExports, undefined,
// Allow multiple storage instances per app.
true);
}
Uninstalling and installing doesn't solve the issue for me. I've tried importing the storage both from the main firebase package ("firebase": "^5.8.0",) and from the stand alone packages ("@firebase/app", "@firebase/auth", "@firebase/firestore", "@firebase/storage"). As soon as I import the storage package I get that error. I'm on Ubuntu 18.04.3 LTS using firebase for a Vue 2.6.10 project built with vue-cli 4.
Stack Trace:
index.esm.js?2e66:3469 Uncaught TypeError: instance.INTERNAL.registerService is not a function
at registerStorage (index.esm.js?2e66:3469)
at eval (index.esm.js?2e66:3473)
at Module../node_modules/@firebase/storage/dist/index.esm.js (chunk-vendors.js:143)
at __webpack_require__ (app.js:791)
at fn (app.js:151)
at eval (index.esm.js?588e:1)
at Module../node_modules/firebase/storage/dist/index.esm.js (chunk-vendors.js:6476)
at __webpack_require__ (app.js:791)
at fn (app.js:151)
at eval (firebase.js?dc59:1)
@ioanmeri did you try a full rm -rf node_modules && rm package-lock.json && npm i?
Thank you @laurentpayot
rm -rf got it running
Happy Xmas : )
Most helpful comment
Thank you @laurentpayot
rm -rf got it running
Happy Xmas : )