Angular-cli: ng serve looses --env argument after code change trigger a rebuild

Created on 5 May 2017  路  5Comments  路  Source: angular/angular-cli

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Versions.

@angular/cli: 1.0.0-rc.4
node: 6.9.4
os: darwin x64
@angular/animations: 4.1.1
@angular/common: 4.1.1
@angular/compiler: 4.1.1
@angular/compiler-cli: 4.1.1
@angular/core: 4.1.1
@angular/forms: 4.1.1
@angular/http: 4.1.1
@angular/platform-browser: 4.1.1
@angular/platform-browser-dynamic: 4.1.1
@angular/platform-server: 4.1.1
@angular/router: 4.1.1
@angular/cli: 1.0.0-rc.4

Repro steps.

  • create a new environmental file, environment.ua.ts', and configure it in.angular-cli.json` accordingly.
  • run ng serve --env=ua
  • observe that the ua is loaded, as expected
  • change the software
  • observe that the default environment is loaded

The log given by the failure.

  • the observed behavior is that the build reverts back to the default environment!
  • there are no logs

Desired functionality.

The automatic build preserves the ua environment!

Mention any other details that might be useful.

I added a note to a similar issue, 6132 to the same effect.

easy (hours) 1 (urgent) regression bufix

All 5 comments

@RodrigoMattosoSilveira I tried to replicate the issue in the current branch as well as latest release. Seems like you are still using the release candidate for CLI @angular/cli: 1.0.0-rc.4. Can you please update to the latest version and check if it's still the issue. Please reopen if it's still the same.

Why is this closed? I am having this issue currently. I start with "ng serve --env local". Everything works fine until I make a change and save. Once it recompiles it's as if I had just run "ng serve". It's like on recompile it forgets the "--env local" option that I added initially.

I am also experiencing this issue with Angular CLI 1.6.5. For me it doesn't lose the environment until after several recompiles.

same here with 1.7.4. initial state of serving is good, after few saves the source environment is loaded. annoying :S

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gotschmarcel picture gotschmarcel  路  3Comments

rajjejosefsson picture rajjejosefsson  路  3Comments

sysmat picture sysmat  路  3Comments

5amfung picture 5amfung  路  3Comments

naveedahmed1 picture naveedahmed1  路  3Comments