Autocompile is not working in angular project while making some chanages

I am running an angular project.

 

While I made some changes i need to run ng s again and again..

in my other machine while I made some changes its auto-compile and refresh the browser  with the recent changes.

12 comments
Comment actions Permalink

do you mean that project re-building is not triggered once you change your code and hit Ctrl+S? Or, code is re-built, but browser is not refreshed? Might be an issue with hanndling safe writes... Please try turning 'Safe write' option ( Settings | Appearance & Behavior | System Settings | Use "safe write" (save changes to temporary file first)) off - does it make any difference?

see also  https://github.com/angular/angular-cli/issues/1610 for some hints

0
Comment actions Permalink

Yes. the project re-building is not triggered once I changed the code and hit Ctrl+S. 

Also I turn off the Safe Write before only..

0
Comment actions Permalink

Strange... Are you using the ng serve command? Does re-building work when you edit and save files outside of the IDE?

0
Comment actions Permalink

Yes I am using ng serve. No once the server started the re-building is not working for the new changes.. even for the simple alert also..

For that again I need to stop the server Ctrl+C and then again I start the server using ng serve.

 

Do I need to use webpack for that??

0
Comment actions Permalink

ng serve uses webpack internally... What OS are you on, what cli version is used? Do you have white spaces/non-ASCII characters in your project path?

0
Comment actions Permalink

UBUNTU 16.04 LTS

Angular CLI: 6.1.3

No, white spaces/non-ASCII characters..  it was working before.. suddenly it stops for me.. The same projects is working fine in other machine. we are three people working on the same project..we are sharing same repository.. its not working for me.. every time i need to stop and re run again ng serve for every small changes..

0
Comment actions Permalink

Hello Elena Pogorelova,

I have an update, may be you will get some idea. 

 

Once I install npm i webpack the re-building is working..

But the thing is that we don't want to install extra package, since it is working in other machine with out installing this package..

So, could you help me now ??

0
Comment actions Permalink

projects created with angular cli do have webpack installed (i believe, cli 6.1.3 bundles webpack @4.9.2)... May be the issue with this particular webpack version (works fine for me though)... No good ideas, sorry. I'd suggest reporting the issue to https://github.com/angular/angular-cli/issues

 

BTW, you can also check if increasing the amount of inotify watchers makes things any better

0
Comment actions Permalink

I faced the same problem. But when I run the ng serve command with a sudo, auto compilation started working. 

It's a bit surprising. I do not understand why but I don't care as long as it works! But I would be happier if someone could explain why.

0
Comment actions Permalink

Thank you Santosh,

sudo ng serve is working for me also

1
Comment actions Permalink

sudo ng serve is NOT working for me.

it shows me : sudo: ng: command not found

0
Comment actions Permalink

Looks like ng is not on your $PATH

0

Please sign in to leave a comment.