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
We're actively investigating and fixing these issues to create a smooth HMR experience out of the box. Production builds and releases are not affected. If you discover any additional HMR challenges which don't appear to be related to the linked issues above, verify that you are on a recent version (19.1.3+), and please file a new issue and link it here so we can triage and investigate.
Workarounds
In the meantime, if you encounter any problems relating to HMR, you can work around them in three ways:
Refresh the page - This loads a fresh copy of your application with up to date code.
ng serve --no-hmr - This disables HMR for your local devserver and automatically refreshes the page on any code changes.
Disable HMR for your project - Configuring angular.json will disable HMR for all ng serve invocations by default.
This is useful for a project with a large number of developers without needing to communicate these workarounds to all contributors.
Remember to re-enable once the relevant issues are fixed!
Thank you for sharing any HMR issues and helping improve Angular one bugfix at a time. We're committed to fully stabilizing this feature and excited to bring improved build performance to everyone.
I updated all my projects to use "@angular/core": "19.1.2" & "@angular/cli": "19.1.3". But now when I start the dev server using "ng serve" and visit the localhost:4200, the nodejs server crashes with the following error:
`
NOTE: Raw file sizes do not reflect development server per-request transformations.
➜ Local: http://localhost:4200/
➜ press h + enter to show help
node:internal/process/promises:394
triggerUncaughtException(err, true /* fromPromise */);
^
Error: [vite] cannot find entry point module 'file:///D:/<PROJECT_FOLDER>/.angular/vite-root/spa-near-me/@ng/component?c=src%2Fapp%2Fcomponents%2Fheader%2Fheader.component.ts%40HeaderComponent&t=1737401566323'.
at fetchModule (file:///D:/<PROJECT_FOLDER>/node_modules/@angular/build/node_modules/vite/dist/node/chunks/dep-BJP6rrE_.js:51477:13)
at async handleInvoke (file:///D:/<PROJECT_FOLDER>/node_modules/@angular/build/node_modules/vite/dist/node/chunks/dep-BJP6rrE_.js:44166:22)
at async EventEmitter.listenerForInvokeHandler (file:///D:/<PROJECT_FOLDER>/node_modules/@angular/build/node_modules/vite/dist/node/chunks/dep-BJP6rrE_.js:44239:19) {`
All my projects are using tailwind CSS and I've also enabled provideExperimentalZonelessChangeDetection() .
This problem goes away if I use ng serve --no-hmr.
I had issues with i18n and $localize which is probably caused by having the project in NX and spread out to several libraries.
So I get errors that $localize is not defined when templates with i18n are reloaded I guess.
We've released versions 19.1.3 of the framework and 19.1.4 of the CLI which resolve the outstanding HMR issues.
If you were encountering issues previously, please consider updating and let us know if you encounter any HMR or reload related problems.
Reacted by Rabik and Daniel Schuba
Reacted by Rabik, Michael Small, Shannon V.C. and Daniel Schuba
I have updated to the latest ng core/cli and can confirm all the errors, warning messages are all gone now. I can run Angular projects locally without using --no-hmr flag now.
Amazing support from Angular team as always! 👏👏
Reacted by Andrew Kushnir, Benito Jimenez and Kunj Patel
We've released versions 19.1.3 of the framework and 19.1.4 of the CLI which resolve the outstanding HMR issues. If you were encountering issues previously, please consider updating and let us know if you encounter any HMR or reload related problems.
Issue Description:
After updating, terminal errors are no longer present.
When copying and pasting Tailwind code, the code appears in the DOM but does not update or fix its position in the UI, even after refreshing.
If an "Enter" key is pressed after the pasted code (e.g., by adding a new line), the styles are applied correctly.
We've released versions 19.1.3 of the framework and 19.1.4 of the CLI which resolve the outstanding HMR issues. If you were encountering issues previously, please consider updating and let us know if you encounter any HMR or reload related problems.
@clydin I have updated both @angular/core and @angular/cli to 19.1.3 and 19.1.4 respectively but still having HMR issue !
When I am creating new project after this release it's not having any issue but older project is still having issue even after updating both packages !
@YashrajDawkhar During a rebuild, Tailwind may internally change other aspects of the application even though a developer may have only made changes to a template. This typically occurs when new Tailwind classes are added to a template and currently requires a full page reload. More advanced Tailwind support is being investigated including built-in support for the recently released Tailwind v4.
@kunjgit Please ensure that all Angular packages have been updated. If you are still encountering problems, please open a separate issue with details of the problem as well as the output of ng version and a minimal reproduction, if possible.
Reacted by Kunj Patel, Garrett Darnell and Yashraj Dawkhar
@dzcora The Angular team does not directly support nx build tooling. However, if you open a separate issue with a minimal reproduction, we can attempt to troubleshoot the problem.
@clydin Our project is huge, and it's too complex to reproduce it.
Actually, even when I build the project with your builders and without NX executors, it's still not working.
I am on core 19.1.7 / cli 19.1.8 -- template HMR is not working at all. No errors thrown. Template changes simply don't get reflected. I had to disable HMR entirely to reload on template changes.
I do see the update event coming through the dev websocket, though. Just nothing happens in the DOM.
Reacted by Marco Glauser, Zinchuk Roman and Thauã Engelmann
@crisbeto Problem located / solved. My Angular app is part of a monorepo in which source code is referenced from other shared locations within the monorepo via compilerOptions.paths in tsconfig.json. These other shared locations live one directory up from the ng app. To support this, I'd added "rootDir": "../" to tsconfig.json.
Removing rootDir fixes it. As it transpires, rootDir wasn't needed at all, as it's working perfectly fine without it.
It may be worth noting that "rootDir": ".." seems to break nothing else -- styles HMR works and reload on component save works. It's just template HMR that's affected, so there may be a wee bug in there, but admittedly it's likely an edge case.
@clydin@crisbeto I can confirm that in new Angular project when adding statsJson:true to the build options in angular.json the HMR is not working.
What is the reason for that?
In my case HMR doesn't work at all, i tried to enable it, but it still reload page after each change in styles and templates
Same here. I get the "Component HMR has been enabled" warning, so I think it's enabled. But any changes to components, templates, or styles always causes a browser refresh. ng serve --verbose doesn't say anything of interest, is there some way to enable more verbose logging?
Activity
YashrajDawkhar commentedon Jan 19, 2025
When we are adding tailwind classes it is not getting reflected due to hmr .
crisbeto commentedon Jan 20, 2025
For anyone following along, we've released versions 19.1.2 of the framework and 19.1.3 of the CLI to resolve the outstanding HMR issues.
bastibense commentedon Jan 20, 2025
Thanks! Can confirm it's working now. 💯
rabikr commentedon Jan 20, 2025
I updated all my projects to use "@angular/core": "19.1.2" & "@angular/cli": "19.1.3". But now when I start the dev server using "ng serve" and visit the localhost:4200, the nodejs server crashes with the following error:
`
NOTE: Raw file sizes do not reflect development server per-request transformations.
➜ Local: http://localhost:4200/
➜ press h + enter to show help
node:internal/process/promises:394
triggerUncaughtException(err, true /* fromPromise */);
^
Error: [vite] cannot find entry point module 'file:///D:/<PROJECT_FOLDER>/.angular/vite-root/spa-near-me/@ng/component?c=src%2Fapp%2Fcomponents%2Fheader%2Fheader.component.ts%40HeaderComponent&t=1737401566323'.
at fetchModule (file:///D:/<PROJECT_FOLDER>/node_modules/@angular/build/node_modules/vite/dist/node/chunks/dep-BJP6rrE_.js:51477:13)
at async handleInvoke (file:///D:/<PROJECT_FOLDER>/node_modules/@angular/build/node_modules/vite/dist/node/chunks/dep-BJP6rrE_.js:44166:22)
at async EventEmitter.listenerForInvokeHandler (file:///D:/<PROJECT_FOLDER>/node_modules/@angular/build/node_modules/vite/dist/node/chunks/dep-BJP6rrE_.js:44239:19) {`
All my projects are using tailwind CSS and I've also enabled
provideExperimentalZonelessChangeDetection().This problem goes away if I use
ng serve --no-hmr.Here are my dependencies
"dependencies": { "@angular/animations": "^19.1.2", "@angular/common": "^19.1.2", "@angular/compiler": "^19.1.2", "@angular/core": "^19.1.2", "@angular/forms": "^19.1.2", "@angular/platform-browser": "^19.1.2", "@angular/platform-browser-dynamic": "^19.1.2", "@angular/platform-server": "^19.1.2", "@angular/router": "^19.1.2", "@angular/ssr": "^19.1.3", "express": "^4.18.2", "rxjs": "~7.8.0", "tslib": "^2.3.0", "zone.js": "~0.15.0" }, "devDependencies": { "@angular-devkit/build-angular": "^19.1.3", "@angular/cli": "^19.1.3", "@angular/compiler-cli": "^19.1.2", "@types/express": "^4.17.17", "@types/jasmine": "~5.1.0", "@types/node": "^18.18.0", "autoprefixer": "^10.4.20", "daisyui": "^4.12.23", "jasmine-core": "~5.5.0", "karma": "~6.4.0", "karma-chrome-launcher": "~3.2.0", "karma-coverage": "~2.2.0", "karma-jasmine": "~5.1.0", "karma-jasmine-html-reporter": "~2.1.0", "lucide-angular": "^0.473.0", "postcss": "^8.5.1", "prettier": "^3.4.2", "tailwindcss": "^3.4.17", "typescript": "~5.7.2", "xmlbuilder": "^15.1.1" }DaSchTour commentedon Jan 21, 2025
I had issues with i18n and $localize which is probably caused by having the project in NX and spread out to several libraries.
So I get errors that $localize is not defined when templates with i18n are reloaded I guess.
crisbeto commentedon Jan 21, 2025
There was a fix in the CLI version 19.1.3 that reloads the page in the presence of
$localize, although I'm not sure if it made its way to Nx.clydin commentedon Jan 22, 2025
We've released versions 19.1.3 of the framework and 19.1.4 of the CLI which resolve the outstanding HMR issues.
If you were encountering issues previously, please consider updating and let us know if you encounter any HMR or reload related problems.
rabikr commentedon Jan 22, 2025
I have updated to the latest ng core/cli and can confirm all the errors, warning messages are all gone now. I can run Angular projects locally without using
--no-hmrflag now.Amazing support from Angular team as always! 👏👏
YashrajDawkhar commentedon Jan 23, 2025
Issue Description:
After updating, terminal errors are no longer present.
When copying and pasting Tailwind code, the code appears in the DOM but does not update or fix its position in the UI, even after refreshing.
If an "Enter" key is pressed after the pasted code (e.g., by adding a new line), the styles are applied correctly.
Bug.-.HMR.mp4
kunjgit commentedon Jan 23, 2025
@clydin I have updated both @angular/core and @angular/cli to 19.1.3 and 19.1.4 respectively but still having HMR issue !
When I am creating new project after this release it's not having any issue but older project is still having issue even after updating both packages !
clydin commentedon Jan 23, 2025
@YashrajDawkhar During a rebuild, Tailwind may internally change other aspects of the application even though a developer may have only made changes to a template. This typically occurs when new Tailwind classes are added to a template and currently requires a full page reload. More advanced Tailwind support is being investigated including built-in support for the recently released Tailwind v4.
@kunjgit Please ensure that all Angular packages have been updated. If you are still encountering problems, please open a separate issue with details of the problem as well as the output of
ng versionand a minimal reproduction, if possible.14 remaining items
dzcora commentedon Feb 20, 2025
@clydin Our project is huge, and it's too complex to reproduce it.
Actually, even when I build the project with your builders and without NX executors, it's still not working.
TimUnderhay commentedon Feb 24, 2025
I am on core 19.1.7 / cli 19.1.8 -- template HMR is not working at all. No errors thrown. Template changes simply don't get reflected. I had to disable HMR entirely to reload on template changes.
I do see the update event coming through the dev websocket, though. Just nothing happens in the DOM.
crisbeto commentedon Feb 24, 2025
@TimUnderhay have you noticed if it happens on specific kinds of components? We can't really investigate without more information.
TimUnderhay commentedon Feb 24, 2025
@crisbeto I'm working on a reproduction for you. I can say that my project is quite simple.
TimUnderhay commentedon Feb 24, 2025
@crisbeto Problem located / solved. My Angular app is part of a monorepo in which source code is referenced from other shared locations within the monorepo via compilerOptions.paths in
tsconfig.json. These other shared locations live one directory up from the ng app. To support this, I'd added"rootDir": "../"totsconfig.json.Removing
rootDirfixes it. As it transpires,rootDirwasn't needed at all, as it's working perfectly fine without it.It may be worth noting that
"rootDir": ".."seems to break nothing else -- styles HMR works and reload on component save works. It's just template HMR that's affected, so there may be a wee bug in there, but admittedly it's likely an edge case.dzcora commentedon Feb 25, 2025
@clydin @crisbeto I can confirm that in new Angular project when adding
statsJson:trueto the build options inangular.jsonthe HMR is not working.What is the reason for that?
crisbeto commentedon Feb 26, 2025
The issue with the
statsJsonwill be fixed by angular/angular-cli#29707.alan-agius4 commentedon Mar 26, 2025
All known problems have been addressed as of 19.2.0.
If you encounter any new issues with component HMR, please open a separate issue and include a minimal reproduction if possible.
roma2341 commentedon Mar 31, 2025
In my case HMR doesn't work at all, i tried to enable it, but it still reload page after each change in styles and templates
dzcora commentedon Apr 23, 2025
Same
anhallbe commentedon May 20, 2025
Same here. I get the "Component HMR has been enabled" warning, so I think it's enabled. But any changes to components, templates, or styles always causes a browser refresh.
ng serve --verbosedoesn't say anything of interest, is there some way to enable more verbose logging?Update: Seems like
"aot": falseis the reason. angular/angular-cli#30352angular-automatic-lock-bot commentedon Jun 21, 2025
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.