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.
Please sign in to leave a comment.
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
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..
Strange... Are you using the
ng servecommand? Does re-building work when you edit and save files outside of the IDE?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??
ng serveuses webpack internally... What OS are you on, what cli version is used? Do you have white spaces/non-ASCII characters in your project path?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..
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 ??
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
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.
Thank you Santosh,
sudo ng serve is working for me also
sudo ng serve is NOT working for me.
it shows me : sudo: ng: command not found
Looks like ng is not on your $PATH