Nativescript-plugin-firebase: Init is not a function iOS

Created on 12 Oct 2020  路  5Comments  路  Source: EddyVerbruggen/nativescript-plugin-firebase

Hi,

I have a project with pure JS (Vainilla) and updated to Nativescript 7.

I can't run the lastest version of plugin.

In app.js I have:
import { firebase } from '@nativescript/firebase';
And the error is:

firebase.init is not a function.

Thanks

Most helpful comment

seems to be solved this way

var firebase = require("@nativescript/firebase").firebase;

please add the info to the documentation!

All 5 comments

the same here, vanilla javascript, import the new plugin, app installed on the emulator but crashes and have the error firebase.init is not a function

here is my code in app.js:
````
var firebase =require("@nativescript/firebase")

setTimeout(()=>{
firebase.init({
...some code
})
},0);
````

@EddyVerbruggen are there any news?

seems to be solved this way

var firebase = require("@nativescript/firebase").firebase;

please add the info to the documentation!

var firebase = require("@nativescript/firebase").firebase;

This solved it for me. Thanks!

Feel free to send a PR to the docs.

Was this page helpful?
0 / 5 - 0 ratings