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.

firebase.init error: TypeError: Cannot read property 'getInstance' of undefined

See original GitHub issue

i try to use firebase plugin in my nativescript core(not angular) project and i noticed that reference.d.ts file not exist in my project to put this line “<reference path='./node_modules/nativescript-plugin-firebase/firebase.d.ts'/>” i try to install and reinstall the plugin and remove /add platform android without any changes and i stuck in this step when i put the following code

firebase.init({ // Optionally pass in properties for database, authentication and cloud messaging, // see their respective docs. }).then( instance => { console.log(“firebase.init done”); }, error => { console.log(firebase.init error: ${error}); } );

any suggestions please

Issue Analytics

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

github_iconTop GitHub Comments

4reactions
EddyVerbruggencommented, Oct 2, 2018

This has been broken since 6.8.1 (in #904) for plugin users on Android, with "authentication": false in firebase.nativescript.json. I’ll fix this today in 7.1.2.

1reaction
EddyVerbruggencommented, Oct 2, 2018

Thanks, @felix-idf, that really helps. I don’t think I’ve tested recent versions with this firebase.nativescript.json config (only using_android and messaging are true):

{
    "external_push_client_only": false,
    "using_ios": false,
    "using_android": true,
    "firestore": false,
    "realtimedb": false,
    "authentication": false,
    "remote_config": 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
}

Looking into it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

firebase.init error: TypeError: Cannot read property 'database ...
I finally solved it by installing the plugin manually via the CLI (i initially installed it through NativeScript sidekick) apparently they ...
Read more >
FirebaseAnalytics - Google
The top level Firebase Analytics singleton that provides methods for logging events and setting user properties. See the developer guides for general ...
Read more >
typeerror: cannot read properties of undefined (reading 'db') - You ...
I've an error comes when I execute (npm start) : TypeError: Cannot read properties of undefined (reading 'database') at Object.<anonymous> (C:\Users\Ahmed ...
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 >
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 >

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