Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"ng serve" not reflecting changes automatically in Angular 17 when parent directory start with dot #26441

Closed
1 task done
albahrawy opened this issue Nov 21, 2023 · 12 comments · Fixed by #26473
Closed
1 task done
Assignees
Labels

Comments

@albahrawy
Copy link

albahrawy commented Nov 21, 2023

Is this a regression?

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

Environment

  • Angular:
  • CDK/Material:
  • Browser(s):
  • Operating System (e.g. Windows, macOS, Ubuntu):
@crisbeto crisbeto transferred this issue from angular/components Nov 21, 2023
@alan-agius4
Copy link
Collaborator

Can you please provide the output of ng v and a minimal reproduction?

@alan-agius4 alan-agius4 added the needs: repro steps We cannot reproduce the issue with the information given label Nov 21, 2023
@albahrawy
Copy link
Author

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 |

                | Initial Total | 106.20 kB

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
Copy link
Collaborator

@albahrawy which IDE are you using?

@albahrawy
Copy link
Author

@alan-agius4
image

@albahrawy
Copy link
Author

Hello, any update for this please?

@alan-agius4
Copy link
Collaborator

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
Copy link
Author

albahrawy commented Nov 23, 2023

the rebuild is not even triggered

@alan-agius4
Copy link
Collaborator

Can you please try using 17.0.3 and report back.

@albahrawy
Copy link
Author

I'm trying to install it right now and I will let you know

@albahrawy
Copy link
Author

albahrawy commented 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

@alan-agius4 alan-agius4 added type: bug/fix freq1: low Only reported by a handful of users who observe it rarely severity3: broken area: @angular-devkit/build-angular and removed needs: repro steps We cannot reproduce the issue with the information given labels Nov 23, 2023
@alan-agius4 alan-agius4 self-assigned this Nov 23, 2023
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Nov 23, 2023
… in a directory that starts with a dot

This commit fixes an issue were previously, application files in a directory that starts with a dot were being ignored from watching.

Closes angular#26441
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Nov 23, 2023
… in a directory that starts with a dot

This commit fixes an issue were previously, application files in a directory that starts with a dot were being ignored from watching.

Closes angular#26441
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Nov 23, 2023
… in a directory that starts with a dot

This commit fixes an issue were previously, application files in a directory that starts with a dot were being ignored from watching.

Closes angular#26441
@alan-agius4 alan-agius4 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 Nov 24, 2023
@alan-agius4 alan-agius4 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 Nov 24, 2023
@blogcraft
Copy link

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.

alan-agius4 added a commit that referenced this issue Nov 27, 2023
… in a directory that starts with a dot

This commit fixes an issue were previously, application files in a directory that starts with a dot were being ignored from watching.

Closes #26441
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Nov 27, 2023
… in a directory that starts with a dot

This commit fixes an issue were previously, application files in a directory that starts with a dot were being ignored from watching.

Closes angular#26441

(cherry picked from commit 28583d0)
alan-agius4 added a commit that referenced this issue Nov 27, 2023
… in a directory that starts with a dot

This commit fixes an issue were previously, application files in a directory that starts with a dot were being ignored from watching.

Closes #26441

(cherry picked from commit 28583d0)
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Dec 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
3 participants