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
{{ message }}
Repository navigation
"ng serve" not reflecting changes automatically in Angular 17 when parent directory start with dot #26441
Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
16.x
Description
following on the 26414 and 26334. I used 17.0.2 as you suggested but still the same issue is there. I have to stop and re-run ng serve again to reflect the changes
Thanks
Reproduction
StackBlitz link:
Steps to reproduce:
1.
2.
Expected Behavior
The application should automatically reflect the changes in the browser without needing to manually restart the server.
Actual Behavior
The application does not update the UI or show any error messages after saving changes. The only workaround is to stop and re-run ng serve.
becuase my workspace conains a lot of angualr lib and demo projects, I was thinking may be that is the reason, so simply
1- I just create a brand new default angular application and hit ng serve
PS D:\my-projects\test-cli> ng serve
2- in app.component.ts I changed title as this and save. we expect to rebuild again and reflect that changes, but nothing happen. I stopped and serve again, ofcourse it reflect the changes.
export class AppComponent {
title = 'test-cli211ssas';
}
3- I tried to change something in css file or even html. it seems that did not watch file changes.
4- back to one of my old projects with version 16.x it works as expected.
I think I figured out the issue,
my development root folder was starts wirh dot "D:\.Nova2024\ngx-nova" and so on. when I rename it to _Nova2024 it works fine
I repeated this with different scenarios.
1- created a folder on D drive with the name "AngTest" and run ng new app-test -> works fine with path "D:\AngTest\app-test"
2- create a folder with name ".ang2App" and repeat the same -> did not trigger build!
3- rename the AngTest by adding a dot at the beggining ".AngTest" "D:\.AngTest\app-test" -> did not trigger build.
4-rename the ".ang2App" by removing the dot from the beggining "ang2App" "D:\ang2App\app-test" -> trigger the build successfully. so, I think the issue is the builder watch function did not resolve the path correctly if it starts with dot. I tried it again with Angular 16.x it works fine at any case
changed the title [-]bug(angualr-builder cli): "ng serve" Not Reflecting Changes Automatically in Angular 17[/-][+]"ng serve" Not Reflecting Changes Automatically in Angular 17 when parent directory start with dot[/+]on Nov 24, 2023
changed the title [-]"ng serve" Not Reflecting Changes Automatically in Angular 17 when parent directory start with dot[/-][+]"ng serve" not reflecting changes automatically in Angular 17 when parent directory start with dot[/+]on Nov 24, 2023
I have a quite large project recently I updated to Angular 17. And when debugging the app, I make a code change (typescript), and the console detects the change, rebuilds. But the browser is the same. I press F5 to reload and the old code is still there. I have to stop everything and do ng serve again to get my changes.
Activity
alan-agius4 commentedon Nov 21, 2023
Can you please provide the output of
ng vand a minimal reproduction?albahrawy commentedon Nov 21, 2023
becuase my workspace conains a lot of angualr lib and demo projects, I was thinking may be that is the reason, so simply
1- I just create a brand new default angular application and hit ng serve
PS D:\my-projects\test-cli> ng serve
Initial Chunk Files | Names | Raw Size
polyfills.js | polyfills | 82.71 kB |
main.js | main | 23.40 kB |
styles.css | styles | 96 bytes |
Application bundle generation complete. [6.307 seconds]
Watch mode enabled. Watching for file changes...
➜ Local: http://localhost:4200/
2- in app.component.ts I changed title as this and save. we expect to rebuild again and reflect that changes, but nothing happen. I stopped and serve again, ofcourse it reflect the changes.
export class AppComponent {
title = 'test-cli211ssas';
}
3- I tried to change something in css file or even html. it seems that did not watch file changes.
4- back to one of my old projects with version 16.x it works as expected.
This is the ng version command line output
Angular CLI: 17.0.2
Node: 20.9.0
Package Manager: npm 10.1.0
OS: win32 x64
Angular: 17.0.4
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Package Version
@angular-devkit/architect 0.1700.2
@angular-devkit/build-angular 17.0.2
@angular-devkit/core 17.0.2
@angular-devkit/schematics 17.0.2
@angular/cli 17.0.2
@schematics/angular 17.0.2
rxjs 7.8.1
typescript 5.2.2
zone.js 0.14.2
alan-agius4 commentedon Nov 21, 2023
@albahrawy which IDE are you using?
albahrawy commentedon Nov 21, 2023
@alan-agius4

albahrawy commentedon Nov 23, 2023
Hello, any update for this please?
alan-agius4 commentedon Nov 23, 2023
Hi @albahrawy,
I am unable to replicate this, can you try to use 17.0.3?
Also, what is exact problem, is the a re-build being performed and not reflected in the browser? or the the rebuild is not even triggered?
albahrawy commentedon Nov 23, 2023
the rebuild is not even triggered
alan-agius4 commentedon Nov 23, 2023
Can you please try using
17.0.3and report back.albahrawy commentedon Nov 23, 2023
I'm trying to install it right now and I will let you know
albahrawy commentedon Nov 23, 2023
I think I figured out the issue,
my development root folder was starts wirh dot "D:\.Nova2024\ngx-nova" and so on. when I rename it to _Nova2024 it works fine
I repeated this with different scenarios.
1- created a folder on D drive with the name "AngTest" and run ng new app-test -> works fine with path "D:\AngTest\app-test"
2- create a folder with name ".ang2App" and repeat the same -> did not trigger build!
3- rename the AngTest by adding a dot at the beggining ".AngTest" "D:\.AngTest\app-test" -> did not trigger build.
4-rename the ".ang2App" by removing the dot from the beggining "ang2App" "D:\ang2App\app-test" -> trigger the build successfully.
so, I think the issue is the builder watch function did not resolve the path correctly if it starts with dot.
I tried it again with Angular 16.x it works fine at any case
fix(@angular-devkit/build-angular): correctly watch files when app is…
fix(@angular-devkit/build-angular): correctly watch files when app is…
fix(@angular-devkit/build-angular): correctly watch files when app is…
[-]bug(angualr-builder cli): "ng serve" Not Reflecting Changes Automatically in Angular 17[/-][+]"ng serve" Not Reflecting Changes Automatically in Angular 17 when parent directory start with dot[/+][-]"ng serve" Not Reflecting Changes Automatically in Angular 17 when parent directory start with dot[/-][+]"ng serve" not reflecting changes automatically in Angular 17 when parent directory start with dot[/+]blogcraft commentedon Nov 24, 2023
This happens to me also with 17.0.2
I have a quite large project recently I updated to Angular 17. And when debugging the app, I make a code change (typescript), and the console detects the change, rebuilds. But the browser is the same. I press F5 to reload and the old code is still there. I have to stop everything and do ng serve again to get my changes.
I will test 17.0.3 and see if problem persists.
fix(@angular-devkit/build-angular): correctly watch files when app is…
fix(@angular-devkit/build-angular): correctly watch files when app is…
fix(@angular-devkit/build-angular): correctly watch files when app is…
angular-automatic-lock-bot commentedon Dec 28, 2023
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.