Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

ng build and ng serve not detecting file changes #2356

Closed
jshthornton opened this issue Sep 26, 2016 · 31 comments
Closed

ng build and ng serve not detecting file changes #2356

jshthornton opened this issue Sep 26, 2016 · 31 comments

Comments

@jshthornton
Copy link

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.

@samuelcalan
Copy link

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

@jshthornton
Copy link
Author

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, notifications@github.com 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
#2356 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACrzGs0JYRg__vEcBD2ItTYxiXLRbPZWks5quRGTgaJpZM4KGug4
.

@udr013
Copy link

udr013 commented Sep 27, 2016

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).

@filipesilva
Copy link
Contributor

See #1610 (comment)

@anbublacky
Copy link

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

@TheCodonist
Copy link

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

@imohabdeen
Copy link

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

@schmorrison
Copy link

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

@hectorMurillo
Copy link

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/webpack@1.2.4"
and npm start or ng serve.

And it should work fine

@ulymor
Copy link

ulymor commented Feb 8, 2017

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.

@ghost
Copy link

ghost commented Mar 8, 2017

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

@RPGillespie6
Copy link
Contributor

@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.

@janmohammadi
Copy link

@hectorMurillo
After executing "npm install --save @ngtools/webpack@1.2.4" i got this Error:

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

@LaOwlLol
Copy link

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.

@kasireddie
Copy link

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 ?

@vasconce7os
Copy link

Thank you @ulymor for #2356 (comment)

@blackgeeknerd
Copy link

@kasireddie use nvm ..google on it

@alxang
Copy link

alxang commented Jan 5, 2018

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

@piyarulps
Copy link

piyarulps commented Mar 19, 2018

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

@RPGillespie6
Copy link
Contributor

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...

@owlstack
Copy link

owlstack commented Apr 1, 2018

I'm having this issue not on Linux but Windows 10 machine and VS Code.

@l-tree
Copy link

l-tree commented Apr 26, 2018

Reporting that this is still an issue with @angular/cli: 1.7.4 on Windows 10.
In my case I need to close Visual Studio Code for the changes to get picked up in the build.

Angular CLI: 1.7.4
Node: 8.9.4
OS: win32 x64
Angular: 5.2.10
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cli: 1.7.4
@angular-devkit/build-optimizer: 0.3.2
@angular-devkit/core: 0.3.2
@angular-devkit/schematics: 0.3.2
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.10.2
@schematics/angular: 0.3.2
@schematics/package-update: 0.3.2
typescript: 2.5.3
webpack: 3.11.0

@j-frost
Copy link

j-frost commented May 9, 2018

Increasing inotify watches and restarting ng serve did not help me.

@chapultepec
Copy link

sudo ng serve works!

@pgfepale
Copy link

sudo ng serve works!

Works me to..

@HongshanLi
Copy link

same issue here with angular 6. I resolved it using
ng serve --watch

@hhsissi
Copy link

hhsissi commented Oct 29, 2018

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 ?

Hi,
Did you manage to solve that behaviour ?

@Anyoks
Copy link

Anyoks commented Feb 25, 2019

I had the same issue working on Vagrant vm on Ubuntu 16.04 LTS.

Angular CLI: 6.0.8
Node: 11.10.0
OS: linux x64
Angular: 6.1.7

I tried all solutions, increasing notify watches, using --watch reinstalling npm and node. Nothing worked.
This is what solved it for me. adding --poll=2000 like so:

ng serve --poll=2000 --host 0.0.0.0

@hwh7
Copy link

hwh7 commented Apr 3, 2019

Ubuntu 18.04 with Angular CLI(7.3.7).

"echo 65536 | sudo tee -a /proc/sys/fs/inotify/max_user_watches" works for me as @piyarulps suggested.

@lflores
Copy link

lflores commented Apr 22, 2019

sudo ng serve works!

Works for me, in Linux 18.01, thanks @pgfepale

pditommaso added a commit to seqeralabs/nf-tower that referenced this issue Jun 9, 2019
@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 9, 2019
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests