Skip to content

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

Closed

Description

@albahrawy

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):

Activity

  1. alan-agius4 commented on Nov 21, 2023

    @alan-agius4
    Collaborator

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

  2. added
    needs: repro steps
    on Nov 21, 2023
  3. albahrawy commented on Nov 21, 2023

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

  4. alan-agius4 commented on Nov 21, 2023

    @alan-agius4
    Collaborator

    @albahrawy which IDE are you using?

  5. albahrawy commented on Nov 21, 2023

    @albahrawy
    Author
  6. albahrawy commented on Nov 23, 2023

    @albahrawy
    Author

    Hello, any update for this please?

  7. alan-agius4 commented on Nov 23, 2023

    @alan-agius4
    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?

  8. albahrawy commented on Nov 23, 2023

    @albahrawy
    Author

    the rebuild is not even triggered

  9. alan-agius4 commented on Nov 23, 2023

    @alan-agius4
    Collaborator

    Can you please try using 17.0.3 and report back.

  10. albahrawy commented on Nov 23, 2023

    @albahrawy
    Author

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

  11. albahrawy commented on Nov 23, 2023

    @albahrawy
    Author

    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

  12. added
    freq1: low
    and removed
    needs: repro steps
    on Nov 23, 2023
  13. self-assigned this
    on Nov 23, 2023
  14. added 3 commits that reference this issue on Nov 23, 2023
    5cb324a
    28583d0
    bbdd2ed
  15. 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
  16. 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
  17. blogcraft commented on Nov 24, 2023

    @blogcraft

    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.

  18. added 3 commits that reference this issue on Nov 27, 2023
    4da732d
    452341b
    a068067
  19. angular-automatic-lock-bot commented on Dec 28, 2023

    @angular-automatic-lock-bot

    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.

  20. locked and limited conversation to collaborators on Dec 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area: @angular-devkit/build-angularfreq1: lowseverity3: brokentype: bug/fix

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions