-
Notifications
You must be signed in to change notification settings - Fork 2.2k
AngularFireModule.initializeApp not using configuration #1281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@Ajonp Thanks for taking the time to post an issue. Can you show the code for the error? Also if you could create a stackblitz or repo of this that would be great. |
Okay setup a repo (put it together fast hope it works). After clone. Make sure you have firebase CLI installed npm install -g firebase-tools -npm install npm run build ionic:build:dev:prod firebase serve Go to localhost:5000 -> should log you into environment-sample-dev.firebaseapp.com Example Site In the picture you can see that it should be allowing environment-sample-dev based on the configuration being used. However it seems to use the ./src/environment/enivronment.ts file instead. This pushes it over to environment-sample-prod which is the wrong envirnoment |
This was related to AOT compiler. When the module loads it is based on an original config and then changes after webpack runs. |
@Ajonp how did you fix that? I have the same problem with AOT compiler and webpack. |
@snakenstein the repo has a full working example now of how to fix. This is using ionic3 but same applies to any aot compliler setup. |
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)
global packages:
local packages:
System:
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)
The text was updated successfully, but these errors were encountered: