Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

ng serve --watch is not watching for code changes #8313

Closed
davidrdz93 opened this issue Nov 2, 2017 · 18 comments
Closed

ng serve --watch is not watching for code changes #8313

davidrdz93 opened this issue Nov 2, 2017 · 18 comments

Comments

@davidrdz93
Copy link

davidrdz93 commented Nov 2, 2017

Bug Report or Feature Request (mark with an x)

- [ x] bug report -> please search issues before submitting
- [ ] feature request

Versions.

@angular/cli: 1.4.9
node: 8.9.0
os: linux x64
@angular/animations: 4.3.6
@angular/common: 4.3.6
@angular/compiler: 4.3.6
@angular/core: 4.3.6
@angular/forms: 4.3.6
@angular/http: 4.3.6
@angular/platform-browser: 4.3.6
@angular/platform-browser-dynamic: 4.3.6
@angular/router: 4.3.6
@angular/cli: 1.4.9
@angular/compiler-cli: 4.3.6
@angular/language-service: 4.3.6
typescript: 2.3.4

Repro steps.

ng serve --port 8080 --watch

The log given by the failure.

The development server is not reloading when changes are made on the code..
It only compiles and serves the project.

I don't know what other information can I supply in order to explain better myself!

@deebloo
Copy link
Contributor

deebloo commented Nov 2, 2017

@davidrdz93 can you provide a sample project with this issue? also ng serve should do livereload without the --watch flag. can you try with that flag?

@davidrdz93
Copy link
Author

I am trying without the --watch flag but it is not working.. Last night I tried reinstalling webpack and It worked for a while! I don't know how to provide a sample project, however let me know if there are another ways to give you more info! Thanks!

@davidrdz93
Copy link
Author

I don't know if there is something in my environment because in my other PC it is livereloading nice!

@Brocco Brocco added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent severity3: broken labels Nov 3, 2017
@davidrdz93
Copy link
Author

I am just realizing that using ng serve with sudo is making it work properly

@scottasmith
Copy link

Hi all,
This may help if it is the same problem I had.
Trying to use ng serve and ng build --watch sometimes worked but mostly they were not watching for code changes and I thought it was something to do with ng.

Then I remembered a problem I had a while back with
inotify watches

I ran this on my Ubuntu machine and it seems to have kicked in and watching code changes:

echo fs.inotify.max_user_watches=524288 | sudo tee /etc/sysctl.d/40-max-user-watches.conf && sudo sysctl --system

Hope it helps

@ilovett
Copy link

ilovett commented Feb 6, 2018

Thanks @scottasmith increasing max watches on ubuntu worked for me

@Paulskit
Copy link

Paulskit commented Feb 8, 2018

@davidrdz93 try this: #9275 (comment)
Helped my solve the same issue.

@filipesilva filipesilva removed P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent severity3: broken labels Feb 14, 2018
@tommueller
Copy link

tommueller commented Feb 27, 2018

For me this also changed from one day to the other, also running the the ng serve as root fixes the problem for me ... I ran an apt upgrade on my Debian 9 maschine today, that updated this packages:

Start-Date: 2018-02-27  09:03:50
Upgrade: libsystemd0:amd64 (236-3~bpo9+1, 237-3~bpo9+1), geoip-database:amd64 (20171107-1~bpo9+1, 20180215-1~bpo9+1), google-chrome-stable:amd64 (64.0.3282.140-1, 64.0.3282.186-1), udev:amd64 (236-3~bpo9+1, 237$
End-Date: 2018-02-27  09:04:10

Maybe that is of any help?!

Angular CLI: 1.6.2
Node: 8.9.4
OS: linux x64

@quirogamauricio
Copy link

@scottasmith 's solution worked for me as well. Thank you.

@udbhav1995
Copy link

udbhav1995 commented Aug 14, 2018

@scottasmith 's solution worked for me as well for angular version 1.6.3

@mmohammad-pk
Copy link

@scottasmith Thanks. It worked for me as well.

@vikasinfobeans
Copy link

Below cmd is working for me

echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

@nikhilbhalwankar
Copy link

Hi all,
This may help if it is the same problem I had.
Trying to use ng serve and ng build --watch sometimes worked but mostly they were not watching for code changes and I thought it was something to do with ng.

Then I remembered a problem I had a while back with
inotify watches

I ran this on my Ubuntu machine and it seems to have kicked in and watching code changes:

echo fs.inotify.max_user_watches=524288 | sudo tee /etc/sysctl.d/40-max-user-watches.conf && sudo sysctl --system

Hope it helps

Thanks a ton. This worked for me like a charm on Ubuntu 18.04 LTS !

@oranjos9
Copy link

watch is not watching for code changes i am using windows

@mgechev
Copy link
Member

mgechev commented Aug 19, 2019

@oranjos9 what's your Angular CLI version?

@mgechev mgechev added the needs: more info Reporter must clarify the issue label Aug 19, 2019
@vijayksingh
Copy link

@mgechev It's not working for me, I haven't installed it globally but only at Project Level

Angular CLI Version: 8.1.1
OS: Windows
I also tried adding a poll option to angular.json configuration and it also doesn't seem to work.

@mgechev
Copy link
Member

mgechev commented Aug 22, 2019

Not sure if that's a problem in the CLI. Happy to see that there's a workaround for linux, but this also makes me thing that the issue is related to permissions or other OS-level configuration.

With the limited information we have here, I don't think there's anything more we can do. I'm closing for now, please comment or open a new issue if you have more insights or you're able to consistently reproduce the problem.

@mgechev mgechev closed this as completed Aug 22, 2019
@mgechev mgechev removed the needs: more info Reporter must clarify the issue label Aug 22, 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 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests