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.

AngularFireModule.initializeApp not using configuration

See original GitHub issue

Version info

Angular: 4.4.3

Firebase: 4.5.0

AngularFire: 5.0.0-rc.2

Other (e.g. Ionic/Cordova, Node, browser, operating system): nahollmo37714n:drinkpublic.com gap4$ ionic info

cli packages: (/Users/gap4/Documents/WEB/drinkpublic.com/node_modules)

@ionic/cli-utils  : 1.13.0
ionic (Ionic CLI) : 3.13.0

global packages:

cordova (Cordova CLI) : 7.0.1

local packages:

@ionic/app-scripts : 3.0.0-201710161925
Cordova Platforms  : none
Ionic Framework    : ionic-angular 3.7.1-201710060319

System:

Android SDK Tools : 26.0.2
ios-deploy        : 1.9.1
Node              : v6.11.4
npm               : 5.4.2
OS                : macOS Sierra
Xcode             : Xcode 9.0 Build version 9A235

How to reproduce these conditions

Manual configuration is not taking affect when setting it up through AngularFireModule.initializeApp(ENV.firebase)

It seems to only pull in .src/environments/environment.ts file

Steps to set up and reproduce

Sample data and security rules

Open

Debug output

** Errors in the JavaScript console **

** Output from firebase.database().enableLogging(true); **

** Screenshots **

Expected behavior

Should be using my development firebase conig.

Actual behavior

Wrong firebase config is provided (my production config)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
snakensteincommented, Oct 27, 2017

@ajonp how did you fix that? I have the same problem with AOT compiler and webpack.

1reaction
codercatdevcommented, Oct 19, 2017

This was related to AOT compiler. When the module loads it is based on an original config and then changes after webpack runs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular 8 + Firebase: Cannot initialize project due to ...
I was able to resolve this issue by copy and pasting the content of environment.ts to environment.prod.ts , like this:
Read more >
Initializing the Firebase dynamically in angular after getting ...
Install @angular/fire package to use Firebase in your angular project. In app.module.ts. Import AngularFireModule from the '@angular/fire' ...
Read more >
How to use the angularfire2.AngularFireModule.initializeApp ...
initializeApp examples, based on popular ways it is used in public projects. ... from 'angularfire2/auth'; const config = { apiKey: process.env.
Read more >
[SOLVED] Do I really need to declare initializeApp twice in ...
Everything is working fine at the moment but I'm not sure why I have to write ... twice in order to use firebase...
Read more >
How to pass Firebase database to use - to a library
import { AngularFireModule } from '@angular/fire'; ... AngularFireModule.initializeApp(firebaseConfig), ... I think you just use --configuration instead?
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