AngularFireModule.initializeApp not using configuration
See original GitHub issueVersion 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:
- Created 6 years ago
- Comments:6 (1 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@ajonp how did you fix that? I have the same problem with AOT compiler and webpack.
This was related to AOT compiler. When the module loads it is based on an original config and then changes after webpack runs.