Skip to content

Runtime Error: instance.INTERNAL.registerService is not a function #2420

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
zarko-tg opened this issue Dec 9, 2019 · 12 comments
Closed

Runtime Error: instance.INTERNAL.registerService is not a function #2420

zarko-tg opened this issue Dec 9, 2019 · 12 comments

Comments

@zarko-tg
Copy link

zarko-tg commented Dec 9, 2019

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

@google-oss-bot
Copy link
Contributor

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.

@laurentpayot
Copy link

Same error message here also since 7.5.1 on Ubuntu 19.10, Node v12.13.1, TypeScript 3.7.3.

@Feiyang1
Copy link
Member

Feiyang1 commented Dec 9, 2019

How did you upgrade firebase? It seems that you upgraded @firebase/app, but not @firebase/database. What other dependencies do you have?

@zarko-tg
Copy link
Author

zarko-tg commented Dec 9, 2019

@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.

@Feiyang1
Copy link
Member

Feiyang1 commented Dec 9, 2019

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?

@zarko-tg
Copy link
Author

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.

@laurentpayot
Copy link

Unlinke @zarko-tg I have a firestore error:

function configureForFirebase(firebase) {
    firebase.INTERNAL.registerService('firestore', function (app) { return new Firestore(app); }, shallowCopy(firestoreNamespace));
}

…but 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.

@Feiyang1
Copy link
Member

@laurentpayot Yep. That should solve your problem.

@laurentpayot
Copy link

Yep. Problem solved. Thanks!

@ioanmeri
Copy link

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)

@laurentpayot
Copy link

@ioanmeri did you try a full rm -rf node_modules && rm package-lock.json && npm i?

@ioanmeri
Copy link

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

@firebase firebase locked and limited conversation to collaborators Jan 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants