Firebase-js-sdk: Runtime Error: instance.INTERNAL.registerService is not a function

Created on 9 Dec 2019  路  12Comments  路  Source: firebase/firebase-js-sdk

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

Screenshot 2019-12-09 at 09 33 33

Screenshot 2019-12-09 at 09 34 25

core

Most helpful comment

Thank you @laurentpayot
rm -rf got it running
Happy Xmas : )

All 12 comments

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

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 : )

Was this page helpful?
0 / 5 - 0 ratings