Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 11.8k
AOT - incorrect environment #2673
Copy link
Copy link
Closed
Labels
P1Impacts a large percentage of users; if a workaround exists it is partial or overly painfulImpacts a large percentage of users; if a workaround exists it is partial or overly painfultype: bug/fix
Description
Activity
Metadata
Metadata
Assignees
Labels
P1Impacts a large percentage of users; if a workaround exists it is partial or overly painfulImpacts a large percentage of users; if a workaround exists it is partial or overly painfultype: bug/fix
OS?
OSX El Capitan
Versions.
angular-cli: 1.0.0-beta.17
node: 6.7.0
os: darwin x64
Repro steps.
-- create a new app with ng new
-- in src/app/app.module.ts
-- then in the NgModule add
-- run
ng build --prod --aotIf you inject AppConfig into a component or service you will get the incorrect environment.
I am pretty sure aot is breaking the environment switching. when statically analyzing the app module aot pulls in the initial config if passing it to module. The only way I have managed to work around is to copy the file with a script before build.