angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

ng serve doesn't re-render files most of the time

Open mp-tbianchi opened this issue 9 years ago • 50 comments

OS?

Windows 10

Versions.

@angular/cli: 1.0.0-rc.0 node: 7.5.0 os: win32 x64 @angular/common: 2.4.8 @angular/compiler: 2.4.8 @angular/core: 2.4.8 @angular/forms: 2.4.8 @angular/http: 2.4.8 @angular/platform-browser: 2.4.8 @angular/platform-browser-dynamic: 2.4.8 @angular/router: 3.4.8 @angular/cli: 1.0.0-rc.0 @angular/compiler-cli: 2.4.8

Repro steps.

Happens all the time since update from beta version

Since I updated, ng serve doesn't rerender the file.
It sees the files that have changed and launches a recompilation but the changes don't get included.
It doesn't do this for a couple of recompilations then it refuses to update the files.

What kind of details can I give you?

Thanks

mp-tbianchi avatar Feb 28 '17 23:02 mp-tbianchi

Noticed it here too.

julianobrasil avatar Mar 01 '17 00:03 julianobrasil

The same issue I encountered since I updated to 1.0.0-rc.0

zhaojunjie163 avatar Mar 01 '17 03:03 zhaojunjie163

Hi, same here

I've installed everything today and after the first launch (with ng serve), every change is listened and the page is rebooted but the changes to the TS are not updated (the TS is not compiled or something)

I've to kill the liveserver and start it again for every change

OS?

Windows 10

Versions.

@angular/cli: 1.0.0-rc.0 node: 6.10.0 os: win32 x64 @angular/common: 2.4.8 @angular/compiler: 2.4.8 @angular/core: 2.4.8 @angular/forms: 2.4.8 @angular/http: 2.4.8 @angular/material: 2.0.0-beta.2 @angular/platform-browser: 2.4.8 @angular/platform-browser-dynamic: 2.4.8 @angular/router: 3.4.8 @angular/cli: 1.0.0-rc.0 @angular/compiler-cli: 2.4.8 @ngtools/webpack: 1.2.11

mfreirehfexp avatar Mar 01 '17 23:03 mfreirehfexp

Hi,

i have the same issue, but it worked 2 Days ago with the 1.0.0-beta.32 Version.

OS: Windows 7 64Bit

Version: @angular/cli: 1.0.0-rc.0 node: 7.7.1 os: win32 x64 @angular/common: 2.4.9 @angular/compiler: 2.4.9 @angular/core: 2.4.9 @angular/forms: 2.4.9 @angular/http: 2.4.9 @angular/platform-browser: 2.4.9 @angular/platform-browser-dynamic: 2.4.9 @angular/router: 3.4.9 @angular/cli: 1.0.0-rc.0 @angular/compiler-cli: 2.4.9

Evekt avatar Mar 02 '17 09:03 Evekt

@Momotanien Did you have a different version 2 days ago?

mp-tbianchi avatar Mar 02 '17 10:03 mp-tbianchi

@mp-tbianchi Ups, sorry forgot to mention it. I updated my entry.

Evekt avatar Mar 02 '17 10:03 Evekt

I had the same issue with rc.0.

instantepiphany avatar Mar 03 '17 09:03 instantepiphany

I believe this may be fixed by a pending PR: https://github.com/angular/angular-cli/pull/5164

instantepiphany avatar Mar 03 '17 13:03 instantepiphany

Hi I've updated to @angular/cli: 1.0.0-rc.1and the problem still remains I deleted the hole node_modules after the update and reinstall everything

mfreirehfexp avatar Mar 06 '17 14:03 mfreirehfexp

Is @angular/cli: 1.0.0-rc.1 released? I can't find it under https://github.com/angular/angular-cli/releases.

crain avatar Mar 07 '17 13:03 crain

Maybe he meant this commit :

https://github.com/angular/angular-cli/commit/214be993c4d5f34e36466d2076dab44bb2226173

mp-tbianchi avatar Mar 07 '17 14:03 mp-tbianchi

Sorry Probably it was a mistake, I put 1.0.0-rc.1 manually on my project and update all. I check it with ng version and didn't realise it could not be publicly released yet

mfreirehfexp avatar Mar 07 '17 14:03 mfreirehfexp

I can't reproduce this in a brand new project. Can you give me exact repro steps? e.g. the project where this happens (a new project for instance, all commands you run to see this, the exact file you change.

filipesilva avatar Mar 08 '17 13:03 filipesilva

https://github.com/angular/angular-cli/issues/5137 might be related, but it happens exclusively with --aot.

filipesilva avatar Mar 08 '17 13:03 filipesilva

I had the same issue with @angular/[email protected]. Since I updgrade from [email protected] Webpack successfully compile changes in ts files but they are not correctly loaded in browser. I have to rerun ng serve to get changes correctly loaded in broswer. Changes are only correctly compile when I change an import in typescript file. It works fine with html and scss files.

I create a brand new project with @angular/[email protected] and got same issue.

OS

Windows 7 x64

Version

@angular/cli : 1.0.0-rc.1 @angular/compiler-cli : 2.4.9 node : 7.5.0

ovalol avatar Mar 08 '17 14:03 ovalol

@ovalol I really need exact reproduction steps, otherwise there isn't much I can do but wait for it to happen randomly.

filipesilva avatar Mar 08 '17 14:03 filipesilva

Hi I'm using W10 I only used the "--scss" flag to get all the scss files compiled and included (great option btw) The other change I did was the custom theme option and added the new Angular Material I continued working with routers, ngrx/store, and firebase. So far it is still happening randomly, but only in TS changes, not in templates or scss changes. I'll try to make a repo so you can be able to test it Thanks!

mfreirehfexp avatar Mar 08 '17 14:03 mfreirehfexp

@filipesilva here steps to reproduce

Steps

  • ng new foo
  • cd foo
  • npm start
  • ng g component bar
  • change {{title}} by <app-bar></app-bar> in app.component.html
  • change bar template with {{title}}
  • add title attribute to BarComponent class with a default value (ex: 'foo-bar').
  • Webpack compile correctly but an empty page is display.
  • rerun npm start and now page correctly display 'foo-bar' string

ovalol avatar Mar 08 '17 14:03 ovalol

Hey, I just tried creating a new project too.

  1. ng new testrepro
  2. cd testrepro
  3. ng serve
  4. Modify AppComponent, for example :
export class AppComponent implements OnInit {
  title = 'app works!';

  private testVar: string;

  ngOnInit(){
    console.log(4);

    this.testVar = 'blabla';
  }
}

Console says recompiling..., lists files that are recompiling and then compiled successfully. But changes can not be seen in the browser.

mp-tbianchi avatar Mar 08 '17 14:03 mp-tbianchi

One thing to add if the page doesn't update and I add an empty line and save the page doesn't still shows the changes. I mean the TS compiler gets freeze, doesn't recover from that point.

mfreirehfexp avatar Mar 08 '17 15:03 mfreirehfexp