angular-cli: Angular Wont Update code changes while debugging after save

Which @angular/* package(s) are the source of the bug?

compiler-cli

Is this a regression?

Yes

Description

Since Angular 17 if I am debugging and app with ng serve, code changes made in my submodules trigger a recompile, browser refreshes, but the same unchanged code is still running.

Please provide a link to a minimal reproduction of the bug

https://github.com/blogcraft/WontUpdateWhileDebugging

Please provide the exception or error you saw

There is no error or Exception, the cli just recompiles as normal and shows the usual chunk files message and the message:

Application bundle generation complete. [0.077 seconds]

Please provide the environment you discovered this bug in (run ng version)

Angular CLI: 17.0.6
Node: 20.9.0
Package Manager: npm 10.1.0
OS: win32 x64

Angular: 17.0.6
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... platform-server, router, service-worker

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1700.6
@angular-devkit/build-angular   17.0.6
@angular-devkit/core            17.0.6
@angular-devkit/schematics      17.0.6
@angular/cdk                    17.0.3
@angular/material               17.0.3
@schematics/angular             17.0.6
rxjs                            7.8.1
typescript                      5.2.2
zone.js                         0.14.2

Anything else?

To see the behaviour while debugging, try to change the message in the src\app\modules\signed-out-module\signed-out.component.ts file.

About this issue

  • Original URL
  • State: closed
  • Created 7 months ago
  • Reactions: 1
  • Comments: 24

Most upvoted comments

@edumserrano, yes please as you are describing another issue. Although from your comment above, I get that the rebuild issue has been fixed in 17.1.0-next.

@blogcraft can you try using the prerelease version of Angular CLI, as under the hood this uses Vite 5.

ng update @angular/cli@next

It threw an error with an incompatible dependency @angular-eslint/schematics

But forced the update with ng update @angular/cli@next --force

image

And so far, it seems to be working fine with @angular/cli@next 🥳

I’ll do some further testing in the full app to see if the problem repeats itself.

@blogcraft can you try using the prerelease version of Angular CLI, as under the hood this uses Vite 5.

ng update @angular/cli@next

Happened to me too. In my case it was not consistant or linked to a single file, it just happened randomly once or twice every hour or so. Shutting down the ng serve and restarting it fixed the problem.