Skip to content

Angular CLI serve re-compiles without change in source #9149

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

Closed
meghma opened this issue Jan 10, 2018 · 3 comments
Closed

Angular CLI serve re-compiles without change in source #9149

meghma opened this issue Jan 10, 2018 · 3 comments

Comments

@meghma
Copy link

meghma commented Jan 10, 2018

Versions

Node: 6.11.3
OS: win32 x64
Angular: 5.1.3
... animations, common, compiler, compiler-cli, core, forms
... http, platform-browser, platform-browser-dynamic
... platform-server, router

@angular/cdk: 5.0.4
@angular/cli: 1.6.3
@angular/language-service: 4.4.6
@angular/material: 5.0.4
@angular-devkit/build-optimizer: 0.0.36
@angular-devkit/core: 0.0.22
@angular-devkit/schematics: 0.0.42
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.3
@schematics/angular: 0.1.11
@schematics/schematics: 0.0.11
typescript: 2.6.2
webpack: 3.10.0

Repro steps

ng serve -env=local

Observed behavior

  1. Sometimes re-compiles repeatedly without any source change
  2. After re-compiling like this a bunch of times, suddenly uses environment.ts instead of environment.local.ts - so then if my settings are respectively in environment.ts and environment.local.ts
    export const baseWebApiUrl = 'http://xxx:999/api/';
    export const baseWebApiUrl = 'http://localhost:63037/api/';
    Angular client tries to access web api at http://xxx:999/api/ .

local is just an example, It happens with env=dev too.

Desired behavior

Mention any other details that might be useful (optional)

When the problem happens I stop ng serve and then do ng build -env=local and then start ng serve -env=local again and things go fine until the problem again happens while re-compiling the wrong environment file is used

@meghma meghma changed the title Angular CLI Build Angular CLI Build Re-compiles without change in source Jan 10, 2018
@meghma meghma changed the title Angular CLI Build Re-compiles without change in source Angular CLI serve re-compiles without change in source Jan 10, 2018
@clydin clydin added command: serve needs: investigation Requires some digging to determine if action is needed labels Jan 10, 2018
@filipesilva filipesilva added type: bug/fix P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent labels Jan 10, 2018
@hansl hansl added freq3: high severity2: inconvenient and removed needs: investigation Requires some digging to determine if action is needed P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent labels Feb 1, 2018
@brian428
Copy link

brian428 commented Jun 12, 2018

I'm also seeing the same thing (wrong environment file being used after a while, during ng serve). To be clear, what seems to happen is that ng serve launches using the correct environment file (e.g. environment.dev.ts), but after a few changes, it seems to switch over to the base environment.ts file.

This is using CLI 1.7.4 (haven't been able to update to 6 yet, due to some other libs not yet migrated to 6).

@filipesilva
Copy link
Contributor

Heya, we're tracking this in #11339 where there is more detail and a better repro case.

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants