Angular-cli: ng serve does not detect file changes

Created on 15 Jun 2017  ·  7Comments  ·  Source: angular/angular-cli

os

  • 7

Versions

-@angular/cli: 1.1.1
node: 7.10.0
os: win32 x64
@angular/animations: 4.2.2
@angular/common: 4.2.2
@angular/compiler: 4.2.2
@angular/core: 4.2.2
@angular/forms: 4.2.2
@angular/http: 4.2.2
@angular/platform-browser: 4.2.2
@angular/platform-browser-dynamic
@angular/router: 4.2.2
@angular/cli: 1.1.1
@angular/compiler-cli: 4.2.2
@angular/language-service: 4.2.2

Steps

-created new project with ng new
-compiled with ng serve -o --watch

I have read and tested all the steps in issue #4338
but i am not able to solve the issue.

As i am new to angular i don't know what is the issue.

So had to stop and reastart ng serve manually

more info 2 (required) broken

Most helpful comment

For Webstorm users, make sure "Use safe write" in the settings is disabled, for myself was bugged by this.

All 7 comments

Please provide some more details

What file did you change?
What change did you make?
What were you expecting to see?
What did you see in the browser?
What did you see in the brower's console?

For Webstorm users, make sure "Use safe write" in the settings is disabled, for myself was bugged by this.

I have the same problem !

my development environment:

node :v6.9.0

@angular/cli: 1.1.1
node: 6.9.0
os: linux x64
@angular/animations: 4.1.3
@angular/common: 4.1.3
@angular/compiler: 4.1.3
@angular/core: 4.1.3
@angular/forms: 4.1.3
@angular/http: 4.1.3
@angular/platform-browser: 4.1.3
@angular/platform-browser-dynamic: 4.1.3
@angular/router: 4.1.3
@angular/cli: 1.1.1
@angular/compiler-cli: 4.1.3
@angular/language-service: 4.1.3

OS-1:Linux localhost.localdomain 4.8.6-201.fc21.x86_64 #1 SMP Wed Nov 

             9 20:21:15 CST 2016 x86_64 x86_64 x86_64 GNU/Linux

OS-2: Linux  3.13.0-74-generic #118~precise1-Ubuntu SMP Fri Dec 

            18 10:38:55 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

tool: sublime

I wrote a code, this code have a problem, this will be an error, the page can not be loaded, the console can see the following information.
abcd

abqa

Then I deleted the problem code, please note that it is not modified, but completely remove this code.

Then I can see the angular cli built-in webpack to re-compile the changed file. But please note that I found that although the compiler but the error still. As if the file had not been modified. But I re-run ng-serve this time will find the error disappears, the page and the console are normal.

So I had to re-run ng-serve

Just now, I found a problem.There is a simple demo on my computer.

How to solve this problem, look forward to everyone's help. Many thanks

I found the reason for my problem, I wrote a service, but I did not import and use the service anywhere. This will appear [angular-cli] did not detect my service file changes. As long as I imported the service in other components, the use of this service, then this time, my service file when the error occurs, it will immediately [angular-cli] compiler, and found.

Versions.

@angular/cli: 1.2.0
node: 8.1.2
os: linux x64
@angular/animations: 4.2.5
@angular/common: 4.2.5
@angular/compiler: 4.2.5
@angular/core: 4.2.5
@angular/forms: 4.2.5
@angular/http: 4.2.5
@angular/platform-browser: 4.2.5
@angular/platform-browser-dynamic: 4.2.5
@angular/platform-server: 4.2.5
@angular/router: 4.2.5
@angular/cli: 1.2.0
@angular/compiler-cli: 4.2.5
@angular/language-service: 4.2.5

Repro steps.

Live reload is not working since I upgrade ng/cli to 1.2.0.
I try vscode and sublime as editor.

Same issue
Ubuntu 16.04

Versions:
"@angular/animations": "^4.0.0",
"@angular/common": "^4.0.0",
"@angular/compiler": "^4.0.0",
"@angular/core": "^4.0.0",
"@angular/forms": "^4.0.0",
"@angular/http": "^4.0.0",
"@angular/platform-browser": "^4.0.0",
"@angular/platform-browser-dynamic": "^4.0.0",
"@angular/router": "^4.0.0",
dev
"@angular/cli": "1.2.0",
"@angular/compiler-cli": "^4.0.0",
"@angular/language-service": "^4.0.0",

I had the same problem in the previous version
"@angular/cli": "1.0.1",
"@angular/compiler-cli": "^4.0.0",

Angular cli started to have the problem that it could not refresh projects upon saving files. So I reinstalled my entire computer. At first Angular cli was working properly again. But after cloning my projects and testing those, I started to have the same problem again....

I had the same problem and stumbled upon #2356. Changing inotify watchers limit as suggested in https://github.com/angular/angular-cli/issues/2356#issuecomment-278298550 was the solution :smile:

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

Was this page helpful?
0 / 5 - 0 ratings