Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

firebase.init error: ReferenceError: Can't find variable: FIROptions #1467

Closed
phiasco12 opened this issue Nov 5, 2019 · 3 comments
Closed

Comments

@phiasco12
Copy link

Hi,

I'm trying to install this plugin in sidekick. the plugin version that's showing in the sidekick is: 10.1.1

I put this code in my app.js:

const firebase = require("nativescript-plugin-firebase");

firebase.init({
  // Optionally pass in properties for database, authentication and cloud messaging,
  // see their respective docs.
}).then(
    function () {
      console.log("firebase.init done");
    },
    function (error) {
      console.log("firebase.init error: " + error);
    }
);

when I run my app on a device and view the sidekick console, I see this error:

LOG from device owner’s iPhone: 
CONSOLE LOG file:///app/vendor.js:1519:24: Error in firebase.init: ReferenceError: Can't find variable: FIROptions
LOG from device owner’s iPhone: CONSOLE LOG file:///app/bundle.js:120:18: firebase.init error: ReferenceError: Can't find variable: FIROptions

is this a known issue with this plugin and is there any workaround?

@EddyVerbruggen
Copy link
Owner

Are you using the Preview app / command to run the app?

@phiasco12
Copy link
Author

Are you using the Preview app / command to run the app?

I'm using the 'Preview App' button inside the Sidekick.

@EddyVerbruggen
Copy link
Owner

Yeah that app doesn't ship with the Firebase plugin installed, so you can't use that wrapper app. You'll need to deploy it to your device/emulator as a standalone app.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants