You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Reacted by FoodBuster, Mirko Mollik, Dessalines, Ekaitz, Matt Langston, Charles Lindberg, Fırat Küçük, shmarlya, Ignat Ignatov, Vladimir Tsymbal and 16 more
I'm having the issue for directories starting with '+'. ng serve and ng build -w works normally: they build the application and wait for changes. If I modify a file in a 'normal' directory (i.e. app.component.ts), the change is detected and ng rebuilds. If I modify a file in a directory whose name starts with '+', nothing happens.
However it's working when I use gedit: when gedit saves a file, it creates a backup that triggers the reload. Reloads also works if I manually create a new file.
I renamed my directories to remove the '+' and in fact the problem happens with any subdirectory of app. If I modify anything directly inside src (i.e. index.html, main.ts, ...) reload works. If I modify something in a subdirectory of src (i.e. src/app/app.component.*, src/app/app.module.ts, src/assets, src/environments/environment.ts, ...) reload works as well. But if I modify something in a subdirectory of app (i.e. src/app/foo/foo.component.ts), there is no reload.
I'm on Ubuntu 14.04 and I can reproduce this with any repository. For example:
ng new project
cd project
ng g c foo
ng serve
Then open a browser on the application. Edit app.component.html as follow:
<h1>
{{title}}
</h1>
<app-foo></app-foo>
Save: ng reloads the app.
Edit foo/foo.component.html as follow:
<p>
foo works! ng reloads?
</p>
Save: ng does not reload.
@filipesilva Do you confirm you cannot reproduce following these steps?
I had the same issue, but managed to fix it. The problem might have to do with folder naming. At first, my main project folder (where I would navigate to before doing "ng serve") was named something like "XX (Front)". I renamed it to "XX_Front" (and flattened the folder structure) and live reload started working.
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.
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.
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.
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
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.
Activity
TheLarkInn commentedon Aug 9, 2016
Are you using the
ng servecommand orng build --watch.Both should work but I ask because we really need more information to accurately tackle this.
burdzand commentedon Aug 9, 2016
I am using ng serve
burdzand commentedon Aug 9, 2016
10% building modules 1/1 modules 0 active
*
*
NG Live Development Server is running on http://localhost:4200.
*
4318ms building modules
38ms sealing
0ms optimizing
0ms basic module optimization
16ms module optimization
1ms advanced module optimization
15ms basic chunk optimization
1ms chunk optimization
0ms advanced chunk optimization
0ms module and chunk tree optimization
58ms module reviving
5ms module order optimization
4ms module id optimization
3ms chunk reviving
0ms chunk order optimization
14ms chunk id optimization
26ms hashing
1ms module assets processing
71ms chunk assets processing
2ms additional chunk assets processing
1ms recording
0ms additional asset processing
127ms chunk asset optimization
864ms asset optimization
25ms emitting
Hash: 3eaa2255197a9b5cb5fd
Version: webpack 2.1.0-beta.18
Time: 5607ms
Asset Size Chunks Chunk Names
main.bundle.js 2.18 MB 0, 2 [emitted] main
polyfills.bundle.js 227 kB 1, 2 [emitted] polyfills
inline.js 4.96 kB 2 [emitted] inline
main.map 2.59 MB 0, 2 [emitted] main
polyfills.map 294 kB 1, 2 [emitted] polyfills
inline.map 5.13 kB 2 [emitted] inline
index.html 476 bytes [emitted]
.npmignore 0 bytes [emitted]
Child html-webpack-plugin for "index.html":
Asset Size Chunks Chunk Names
index.html 2.4 kB 0
webpack: bundle is now VALID.
filipesilva commentedon Aug 18, 2016
I'm seeing the live reload working myself. Can you give very exact repro steps so we can see if there's something missing?
281330 commentedon Aug 21, 2016
I am having the same issue after I cloned a project from my repo.
On my regular machine, I see a lot of something like
"69% building modules 1054/1062 modules 8 active ..", etc.But on my other machine, I only see this -
Now, when I make any changes to my code, it doesn't reload.
filipesilva commentedon Aug 23, 2016
If you can provide us with a repo where this behaviour happens, we can investigate. Otherwise I'm not really able to reproduce this behaviour.
giovapanasiti commentedon Sep 7, 2016
I'm having same issue. My ng version is: angular-cli: 1.0.0-beta.11-webpack.2
ng serve works without live reload and ng build --watch only build the app and then quit without even serving the app on localhost
osechet commentedon Sep 8, 2016
I'm having the issue for directories starting with '+'.
ng serveandng build -wworks normally: they build the application and wait for changes. If I modify a file in a 'normal' directory (i.e. app.component.ts), the change is detected andngrebuilds. If I modify a file in a directory whose name starts with '+', nothing happens.However it's working when I use gedit: when gedit saves a file, it creates a backup that triggers the reload. Reloads also works if I manually create a new file.
osechet commentedon Sep 9, 2016
I renamed my directories to remove the '+' and in fact the problem happens with any subdirectory of
app. If I modify anything directly insidesrc(i.e.index.html,main.ts, ...) reload works. If I modify something in a subdirectory ofsrc(i.e.src/app/app.component.*,src/app/app.module.ts,src/assets,src/environments/environment.ts, ...) reload works as well. But if I modify something in a subdirectory ofapp(i.e.src/app/foo/foo.component.ts), there is no reload.I'm on Ubuntu 14.04 and I can reproduce this with any repository. For example:
Then open a browser on the application. Edit
app.component.htmlas follow:Save: ng reloads the app.
Edit
foo/foo.component.htmlas follow:Save: ng does not reload.
@filipesilva Do you confirm you cannot reproduce following these steps?
FoodBuster commentedon Sep 12, 2016
I had the same issue, but managed to fix it. The problem might have to do with folder naming. At first, my main project folder (where I would navigate to before doing "ng serve") was named something like "XX (Front)". I renamed it to "XX_Front" (and flattened the folder structure) and live reload started working.
filipesilva commentedon Sep 20, 2016
@osechet I followed your instructions and had a life reload be triggered when changing
foo/foo.component.html.I'm using
beta.14and VSCode as an editor, if that helps. Do you also get this inbeta.14?osechet commentedon Sep 20, 2016
I'm using vscode as well but I tested several editors to see if there was a difference. I'm not yet using beta.14. I will try during the week.
91 remaining items
rightisleft commentedon Apr 16, 2018
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.
virgil-av commentedon Aug 16, 2018
This is still a problem, same behaviour on a Fedora / Windows 10 machine
kaushik-kumar-roy commentedon Aug 17, 2018
i used
sudo ng serveand it was working.chapultepec commentedon Sep 13, 2018
@KAUSHIK-ROY that's right!
sudo ng serveis the solutionThe same issue: #11224
doanthai commentedon Oct 16, 2018
It's work with me. Thanks.
samuelzapote commentedon Dec 4, 2018
Solution offered by @cabaleirog worked for me. (Ubuntu)
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.
narenkram commentedon Dec 10, 2018
This solved the issue on my Angular 7 project in Ubuntu. Thank you @sergiyvoytovych
mgechev commentedon Dec 17, 2018
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.
karthicktkm commentedon Feb 17, 2019
You just run following command it will work when you're did any changes. app will auto-deploy.
ng serve -o
scorbin commentedon Mar 12, 2019
@Narain96 - thanks, your solution works for me
emgillis commentedon May 12, 2019
I have been having the same issue. Only solution that works is the
--poll=1000option.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 newng new foobarappthat I created. Nothing else in it, but the recompile & reload doesn't happen on saved changes without the--poll=1000My Angular version info:
CedX commentedon May 23, 2019
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_modulesfolder, using the--pollparameter, changing theinotifywatchers on Linux), nothing has worked. It's probably related to the layout of my project, or the contents of thetsconfig.jsonfiles, becauseng serveworks as expected on a minimal app generated withng 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-automatic-lock-bot commentedon Sep 9, 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.