EddyVerbruggen / nativescript-plugin-firebase

:fire: NativeScript plugin for Firebase
https://firebase.google.com
MIT License
1.01k stars 448 forks source link

No questions asked and no firebase config file generated #1795

Open acs-acs opened 3 years ago

acs-acs commented 3 years ago

The base for my project is the JS Version of the New World sample provided by NativeScript. I'm installing this plugin using the following taken directly from the installation guide:

tns plugin add @nativescript/firebase

When I run that command, I see the loading bar, and the plugin is installed. I'm never asked any questions like the installation guide says I should be, but it install successfully anyway. However, when I run the sample with the iOS simulator, I'm getting the following error:

Firebase.init error: ReferenceError: FIROptions is not defined

After doing some digging through other git issues, I found a lot of people suggest changing the firebase.nativescript.json file. I tried looking for my version of it, but couldn't find it. I re-read the installation guide and realized that this should've also been created during the plugin installation but it wasn't, and I'm entirely sure why. I tried uninstalling the plugin and tried to install it again but I was still never asked any questions and the file was still never generated. Although, I'm using NativeScript version 7+, I did try the installation command for NativeScript 6 but it ran the exact same way, just as you would expect.

stewardjornsen commented 3 years ago

I noticed the same. Perhaps that would be fixed soon. What I did was navigate to the firebase directory inside node_modules. /node_modules/@nativescript/firebase Fire up a terminal there and run

npm run setup

If you have previously set up and want to make changes, then run

npm run config

I hope I got that right :) Some others might comment later to state if this approach is acceptable.

acs-acs commented 3 years ago

I noticed the same. Perhaps that would be fixed soon. What I did was navigate to the firebase directory inside node_modules. /node_modules/@nativescript/firebase Fire up a terminal there and run

npm run setup

If you have previously set up and want to make changes, then run

npm run config

I hope I got that right :) Some others might comment later to state if this approach is acceptable.

Thanks for the advice @stewardjornsen

I'll give this a try and report back!

acs-acs commented 3 years ago

I noticed the same. Perhaps that would be fixed soon. What I did was navigate to the firebase directory inside node_modules. /node_modules/@nativescript/firebase Fire up a terminal there and run

npm run setup

If you have previously set up and want to make changes, then run

npm run config

I hope I got that right :) Some others might comment later to state if this approach is acceptable.

You're an absolute legend dude!! It worked!

Although it's a bit of a 'hacky' fix, it works nonetheless. I'm very happy!