webpack live reload is not working.
I have installed the webpack but the live reload is not working , it is building the modules and caching it.
Linux 4.4.0-31-generic node v6.2.2 npm v3.10.5
angular-cli: 1.0.0-beta.11-webpack node: 6.2.2 os: linux x64
This still happens, I've just installed angular cli and it doesn't work properly.
I'm just following the angular guide.
The error is the same.
When you run ng serve -o and make some basic editing it won't reload automatically.
Solution by @thesunnypro and @alexsaraiva work for me, but I'm still wondering why this happens.
ng -v
Angular CLI: 1.6.7
Node: 6.10.1
OS: linux x64
Angular: 5.2.3
@angular/cli: 1.6.7
@angular-devkit/build-optimizer: 0.0.42
@angular-devkit/core: 0.0.29
@angular-devkit/schematics: 0.0.52
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.7
@schematics/angular: 0.1.17
typescript: 2.5.3
webpack: 3.10.0
uname -rms
Linux 4.14.16-200.fc26.x86_64 x86_64
Had the same problem when running the ng serve command (updating files had no effect what so ever)
I solved the issue by re-installing nodes_modules, It also works with the --poll option without needing to re-install the nodes_modules (@alexsaraiva solution), So either one worked for me.
Steps for solution:
rm -rf nodes_modules/
npm update
npm install
if still not working after re-installing the node_modules then try ng serve --poll=1000 or ng serve --poll=2000
This is my setup:
Angular CLI: 1.7.0
Node: 8.9.4
OS: linux x64
Angular: 5.2.5
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router
@angular/cli: 1.7.0
@angular-devkit/build-optimizer: 0.3.1
@angular-devkit/core: 0.3.1
@angular-devkit/schematics: 0.3.1
@ngtools/json-schema: 1.2.0
@ngtools/webpack: 1.10.0
@schematics/angular: 0.3.1
@schematics/package-update: 0.3.1
typescript: 2.5.3
webpack: 3.11.0
I am using Centos, and increasing the amount of inotify watchers worked for me.
It is also applicable to Ubuntu users.
--poll=1000 causes my cpu to spike insanely high when running docker / archlinux
I dont understand why this ticket was closed
https://github.com/angular/angular-cli/issues/2748#issuecomment-349821610
This is not an issue with low inotify watchers, the alpine node base image has the following:
/app # sysctl -a | grep inotify fs.inotify.max_queued_events = 16384 fs.inotify.max_user_instances = 128 fs.inotify.max_user_watches = 524288
Even if this issue is related to low inotify watchers, it is not an OS issue but an Angular issue. We should not to hack our systems to run an Angular project!
It would be great if the angular team and @filipesilva put together an official docker hub container with the angular client working in it. It would allow us to narrow the possibility space for whats failing across these numerous build approaches.
This is still a problem, same behaviour on a Fedora / Windows 10 machine
i used sudo ng serve and it was working.
@Kaushik-Roy that's right!
sudo ng serve is the solution
The same issue: #11224
ng serve --poll=1000 works for me fine Thanks
It's work with me. Thanks.
Solution offered by @cabaleirog worked for me. (Ubuntu)
After trying multiple options, I solved the issue by reinstalling nodes_modules. Hope it helps.
Steps
- rm -rf nodes_modules/
- npm update
- npm install
My app.component changes were triggering the update. But all the other components I made to place within the app would not trigger any updates to the view of my app. This solution made any changes I made update the view, and it works accordingly now.
ng serve --poll=1000
This solved the issue on my Angular 7 project in Ubuntu. Thank you @sergiyvoytovych
Looks like there's already a solution for the issue. It's strange that I cannot reproduce it at all though. Please try updating to the latest CLI version. In case you hit this problem again, please share a repository with a minimal demo so we can reproduce the bug and open a new issue.
You just run following command it will work when you're did any changes. app will auto-deploy.
ng serve -o
@narain96 - thanks, your solution works for me
I have been having the same issue. Only solution that works is the --poll=1000 option.
The issue itself definitely appears to be Angular version dependent. I have a project folder with a local Angular version of 5.2.0 and the recompile and reload on saved changes works no problem. My global Angular 7 version does not allow for this. The --poll=1000, however, does spike my CPU (as @rightisleft mentions). This is also true for a brand new ng new foobarappthat I created. Nothing else in it, but the recompile & reload doesn't happen on saved changes without the --poll=1000
My Angular version info:
Angular CLI: 7.3.9
Node: 10.15.2
OS: darwin x64
Angular: 7.2.15
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.13.9
@angular-devkit/build-angular 0.13.9
@angular-devkit/build-optimizer 0.13.9
@angular-devkit/build-webpack 0.13.9
@angular-devkit/core 7.3.9
@angular-devkit/schematics 7.3.9
@angular/cli 7.3.9
@ngtools/webpack 7.3.9
@schematics/angular 7.3.9
@schematics/update 0.13.9
rxjs 6.5.2
typescript 3.2.4
webpack 4.29.0
More or less the same issue here: all HTML and CSS files are properly watched, but not the TypeScript files. Whatever the solution applied (removing/reinstalling the node_modules folder, using the --poll parameter, changing the inotify watchers on Linux), nothing has worked. It's probably related to the layout of my project, or the contents of the tsconfig.json files, because ng serve works as expected on a minimal app generated with ng new.
Tested with Node.js 12.2.0 and 12.3.0 on Windows 10 and Ubuntu 19.04: in my case, the issue is clearly not OS-dependant.
Angular CLI: 7.3.9
Node: 12.3.0
OS: win32 x64
Angular: 7.2.15
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.13.9
@angular-devkit/build-angular 0.13.9
@angular-devkit/build-optimizer 0.13.9
@angular-devkit/build-webpack 0.13.9
@angular-devkit/core 7.3.9
@angular-devkit/schematics 7.3.9
@angular/cli 7.3.9
@ngtools/webpack 7.3.9
@schematics/angular 7.3.9
@schematics/update 0.13.9
rxjs 6.5.2
typescript 3.2.4
webpack 4.29.0
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.