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

ng build and ng serve not detecting file changes

Open jshthornton opened this issue 10 years ago • 31 comments

Ubuntu 16.04 angular-cli: 1.0.0-beta.15 node: 6.6.0 os: linux x64 watchman: 4.7.0

Run either ng build --watch or ng serve. Change any file inside of src, no changes detected.

jshthornton avatar Sep 26 '16 16:09 jshthornton

Same here. Since update to 1.0.0-beta.15 it doesn't work. It used to work with beta.14.

samuelcalan avatar Sep 27 '16 12:09 samuelcalan

Didn't work for me in beta 14 either. Didn't work using node events nor watchman.

On Tue, 27 Sep 2016 13:52 nehemia, [email protected] wrote:

Same here. Since update to 1.0.0-beta.15 it doesn't work. It used to work with beta.14.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/angular/angular-cli/issues/2356#issuecomment-249855569, or mute the thread https://github.com/notifications/unsubscribe-auth/ACrzGs0JYRg__vEcBD2ItTYxiXLRbPZWks5quRGTgaJpZM4KGug4 .

jshthornton avatar Sep 27 '16 12:09 jshthornton

I noticed when i make a new project in a folder containing white spaces in the name/path some files are missing in node-modules (970 folders)and auto update doesn't work. When creating a project in a folder without white spaces everything works fine, node-modules(978 folders). (This is on Linux mint).

udr013 avatar Sep 27 '16 13:09 udr013

See https://github.com/angular/angular-cli/issues/1610#issuecomment-251995850

filipesilva avatar Oct 06 '16 15:10 filipesilva

I'm using agular cli to create and serve a project, after editing a file it doesnot auto update the server, i have to restart the ng serve again.

I tried ng serve and ng build --watch , both not working

Output of ng -v

angular-cli: 1.0.0-beta.18 node: 6.2.2 os: linux x64

anbublacky avatar Oct 27 '16 08:10 anbublacky

just remove spaces and special characters from all root directories of project directory(inclusive).

TheCodonist avatar Dec 17 '16 09:12 TheCodonist

I'm using agular cli to create and serve a project, after editing a file it doesnot auto update the server, i have to restart the ng serve again.

I tried ng serve and ng build --watch , both not working

re install npm install , also i checked the folder names but still not working

imohabdeen avatar Jan 22 '17 18:01 imohabdeen

No problems here with ng build --watch

~$: ng version --verbose
angular-cli: 1.0.0-beta.25.5
http_parser: 2.7.0
node: 7.4.0
v8: 5.4.500.45
uv: 1.10.1
zlib: 1.2.8
ares: 1.10.1-DEV
modules: 51
openssl: 1.0.2j
icu: 58.2
unicode: 9.0
cldr: 30.0.3
tz: 2016j
os: linux x64

schmorrison avatar Jan 23 '17 21:01 schmorrison

For those who use windows:

It is a bug in the latest CLI. Execute the following command in your project folder: "npm install --save @ngtools/[email protected]" and npm start or ng serve.

And it should work fine

hectorMurillo avatar Feb 05 '17 20:02 hectorMurillo

I faced with the same problem on Ubuntu 16.04 and angular CLI 1.0.0-beta.30

The problem was related with Inotify Watches Limit on Linux. To solve to issue I increased the watches limit to 512K

sudo sysctl fs.inotify.max_user_watches=524288
sudo sysctl -p --system

After that I restarted my IDE (WebStorm in my case) and after that the change detection started to work.

ulymor avatar Feb 08 '17 11:02 ulymor

I am facing the same problem Is it because i have a .git folder in my root directory

ghost avatar Mar 08 '17 06:03 ghost

@ulymor Thank you, your comment helped me find the root issue. Apparently Sublime 3 has a known bug that uses up all of the inotify watches. Once I closed Sublime, suddenly ng serve started working properly again.

RPGillespie6 avatar Apr 07 '17 19:04 RPGillespie6

@hectorMurillo After executing "npm install --save @ngtools/[email protected]" i got this Error:

ERROR in ./src/main.ts Module build failed: TypeError: Cannot read property 'newLine' of undefined

janmohammadi avatar May 14 '17 00:05 janmohammadi

Anyone finding this on Google:

I encountered this issue on Ubuntu 16.04 with Angular/cli 1.0.3 while using Sublime Text 3.

From reading @RPGillespie6 comment, I close all my instances of Sublime Text, ctrl + c on running ng serve. Restart ng serve and reopen Sublime Text. I modify a file and save and everything works fine.

Before closing out Sublime Text I had tried restarting ng serve multiple attempts did not fix the problem.

LaOwlLol avatar May 30 '17 03:05 LaOwlLol

when i am using ng -v: i am getting this: Mg++ version: Mg++ 1.5beta1 (formerly MicroGnuEmacs Adv.) and ng serve; -----Mg: serve (fundamental)----All------------------

what i need to do to work ng serve ?

kasireddie avatar Jul 28 '17 11:07 kasireddie

Thank you @ulymor for https://github.com/angular/angular-cli/issues/2356#issuecomment-278298550

vasconce7os avatar Aug 22 '17 20:08 vasconce7os

@kasireddie use nvm ..google on it

blackgeeknerd avatar Nov 23 '17 11:11 blackgeeknerd

@ulymor i have tried lot of ways to resolve it but your comments helped.... Thanks a lot.

alxang avatar Jan 05 '18 10:01 alxang

hello guys, this problem was related to Inotify Watches limit on Linux. this command run and issue is solved,

cho 65536 | sudo tee -a /proc/sys/fs/inotify/max_user_watches

and run ng serve or ng build. And it should work fine

piyarulps avatar Mar 19 '18 13:03 piyarulps

The problem is that other programs are competing for inotifies as well (VSCode, etc.) and angular-cli doesn't tell you that you are out, it just silently fails. Sometimes the solution is that you need to close another program that is using up inotifies...

RPGillespie6 avatar Mar 21 '18 18:03 RPGillespie6