ng build --watch doesn't work

See original GitHub issue

Bug Report or Feature Request (mark with an x)

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

Versions.

@angular/cli: 1.3.0-beta.0 node: 6.10.3 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/router: 4.2.5 @angular/cli: 1.3.0-beta.0 @angular/compiler-cli: 4.2.5 @angular/language-service: 4.2.5

Repro steps.

  1. Create your project on a shared folder (guest = centos 7, host= windows 7, provider = virtualbox)
  2. run: ng build --watch -> first compilation is fine
  3. modify a file in the project to force recompilation -> nothing happens

The log given by the failure.

No logs, nothing happens

Desired functionality.

Should recompile

Mention any other details that might be useful.

To summarize, the --watch functionality doesn’t seem to work on shared folders, which is painfull. I confirm that it works perfectly when run on the host directly. If I remember well, I have already had this kind of problem with typescript (which also have the --watch functionality), so it’s may be the same root cause. For information, when I encountered this problem on a previous projects with typescript, I fixed it by using the gulp.watch function. So if I’m right and the problem is the same, you could maybe consider using the same mechanism than gulp to watch files modifications.

Hope you’ll find a solution.

Regards

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
conorjohncommented, Apr 10, 2018

Because the documentation is so vague, I’m just going to comment the command that is working for me on CLI -v 1.7.4.

ng build --output-path=extension-src --watch --poll 1000 - 1000ms or 1 sec

I’m using the --output-path to bundle my code into another folder to be read from, so if that’s not necessary for you then you can just remove that flag. I hope this helps anyone with the same problem.

0reactions
angular-automatic-lock-bot[bot]commented, Sep 8, 2019

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ng build --watch does not work when building a library #11617
ng build --watch does not work when building a library #11617 · Bug Report or Feature Request (mark with an x ) ·...
Read more >
Angular ng build --watch seems to be broken in angular ...
I came across a nice solution that did not work for Angular 11, however, after downgrading to Angular 10, this works.
Read more >
Angular: Watch Build for Changes - JavaScript in Plain English
You may use the watch option on Angular build for updating the output as and when developers make changes to the code. It...
Read more >
package manager ng build doesn't stop
So I installed @angular/cli package from npm in global mode (npm install @angular/cli -g). Now ng build command is available from package manager....
Read more >
Deployment - Angular
On the first terminal, run the ng build command in watch mode to compile the application to the dist folder. content_copy ng build...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found