angular / angular

Deliver web apps with confidence 🚀
https://angular.dev
MIT License
96.36k stars 25.57k forks source link

NG_HMR_TEMPLATES not working #58926

Open cesco69 opened 3 days ago

cesco69 commented 3 days ago

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

Don't known / other

Is this a regression?

Yes

Description

I tried the template HMR on a new project created with Angular v19.0.2. As I read some days ago into another issue related to template HMR, there was a problem that's now fixed in the v19.0.1 by this commit... but it isn't working at all: the CLI prints a message saying "Component update sent to client(s).", an event is sent in the Angular websocket but nothing happens.

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

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

Angular CLI: 19.0.2
Node: 20.13.1
Package Manager: pnpm 9.1.2
OS: win32 x64

Angular: 19.0.1
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1900.2 (cli-only)
@angular-devkit/build-angular   19.0.2
@angular-devkit/core            19.0.2 (cli-only)
@angular-devkit/schematics      19.0.2 (cli-only)
@angular/cli                    19.0.2
@schematics/angular             19.0.2 (cli-only)
rxjs                            7.8.1
typescript                      5.6.3
zone.js                         0.15.0

Anything else?

No response

JeanMeche commented 3 days ago

Hi, I just created a new project with ng new, enabled the flag with NG_HMR_TEMPLATES=1, edited the app.component.html could observe the HMR.

We're going to need some more details/a repro for this to be actionable to us. Thank you.

juane1000 commented 2 days ago

Same issue. Updated to 19.0.1 after a clean project of v19 and HMR templates simply does not update the view. Tried changing on app.component and a nested route component.

EDIT: Just created a new project with the latest cli installed. Verified that installed deps are 19.0.1. Ran with the HMR flag in the command. Tested using the AppComponent template and continue to get the "Component update sent to client(s)" in the terminal but nothing updates in the browser view.

For added clarification: I do see the "Experimental support for component template hot replacement has been enabled via the "NG_HMR_TEMPLATE" environment variable." message so I know that it took the flag.