question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error in firebase.login: TypeError: Cannot read property 'getInstance' of undefined JS: TypeError: Cannot read property 'getInstance' of undefined

See original GitHub issue

i try to use firebase plugin in my nativescript (with Angular) project

firebase.init works fine with

firebase.init({
            showNotificationsWhenInForeground: true
        }).then(
            () => {
                console.log('firebase.init done');
            },
            (error) => {
                console.log(`firebase.init error: ${error}`);
            }
        );

but if i try to call:

firebase.login({
            type: firebase.LoginType.PASSWORD,
            passwordOptions: {
                email: this.user.email,
                password: this.user.password
            }
        })
        .then((result) => JSON.stringify(result))
        .catch((error) => console.log(error));

then i got this error: Error in firebase.login: TypeError: Cannot read property 'getInstance' of undefined.

i have already enabled email-password login in my firebase instance. and this is my firebase.nativescript.json:

{
    "external_push_client_only": false,
    "using_ios": true,
    "using_android": true,
    "firestore": true,
    "realtimedb": false,
    "authentication": true,
    "remote_config": false,
    "performance_monitoring": false,
    "messaging": true,
    "crashlytics": false,
    "crash_reporting": false,
    "storage": false,
    "functions": false,
    "facebook_auth": false,
    "google_auth": false,
    "admob": false,
    "invites": false,
    "dynamic_links": false,
    "ml_kit": false
}

any suggestions please

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
b02505048commented, Mar 22, 2019

I solved this issue with simply rerun npm run config in node_modules/nativescript-plugin-firebase Give it a try guys 😉

0reactions
daddachcommented, Mar 25, 2019

I solved this issue with

rm -rf platforms && rm -rf node_modules

then

tns run <plattform>
Read more comments on GitHub >

github_iconTop Results From Across the Web

Firebase: TypeError: Cannot read properties of undefined ...
The createUser() method returns a UserRecord which has no user property. Also it seems you are trying to get a user's ID Token...
Read more >
Cannot read property of undefined react functional ... - hs-barssel.de
TypeError : Cannot read property 'getInstance' of null. map is not a function. Categories I'm currently getting the error: Cannot read property 'title'...
Read more >
Why is my currentUser == null in Firebase Auth? - Medium
This means that the SDK is not going to block the main thread of execution in order to deliver data — the object...
Read more >
Uncaught TypeError: Cannot read property of undefined
If you get undefined error, you need to make sure that which ever variables throws undefined error, is assigned a value to it....
Read more >
FirebaseUI for Web — Auth - Firebase Open Source
The FirebaseUI component implements best practices for authentication on mobile devices and websites, helping to sign-in and sign-up conversion for your app. It ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found