Title: Template diagnostics not updated in watch mode on Windows when the type-check block is unchanged · Issue #34725 · angular/angular-cli · GitHub
Open Graph Title: Template diagnostics not updated in watch mode on Windows when the type-check block is unchanged · Issue #34725 · angular/angular-cli
X Title: Template diagnostics not updated in watch mode on Windows when the type-check block is unchanged · Issue #34725 · angular/angular-cli
Description: Command serve 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 No response Description On Windows, during ng serve, a template edit that changes Angu...
Open Graph Description: Command serve 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 No response Description On Windows, during ng ...
X Description: Command serve 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 No response Description On Windows, during ng ...
Opengraph URL: https://github.com/angular/angular-cli/issues/34725
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Template diagnostics not updated in watch mode on Windows when the type-check block is unchanged","articleBody":"### Command\n\nserve\n\n### Is this a regression?\n\n- [ ] Yes, this behavior used to work in the previous version\n\n### The previous version in which this bug was not present was\n\n_No response_\n\n### Description\n\nOn Windows, during `ng serve`, a template edit that changes Angular diagnostics without changing the generated type-check code is not diagnosed: a stray `\u003c/span>` (`NG5002`) still ends with \"Application bundle generation complete\", and `[attr.width.px]` never shows `NG8106`. Linux and `ng build` report both correctly.\n\nThe resource check that invalidates `diagnosticCache` ([aot-compilation.ts#L334](https://github.com/angular/angular-cli/blob/8b26efa1ba2b922d459f88add85e7e9a9a1dd9de/packages/angular/build/src/tools/angular/compilation/aot-compilation.ts#L334)) looks up forward-slash paths from `getResourceDependencies()` in `modifiedFiles`, which holds `path.normalize`d backslash paths ([source-file-cache.ts#L42](https://github.com/angular/angular-cli/blob/8b26efa1ba2b922d459f88add85e7e9a9a1dd9de/packages/angular/build/src/tools/esbuild/angular/source-file-cache.ts#L42)), so it never matches on Windows:\n\n```\nmodifiedFiles: [\"C:\\\\repro\\\\src\\\\app\\\\app.html\"]\nresourceDependencies: [\"C:/repro/src/app/app.html\"]\nmatch: false (Linux: true)\n```\n\nEdits that change the `.ngtypecheck.ts` shim are still picked up by the TypeScript builder; the others rely on this check alone. A possible fix is `hostOptions.modifiedFiles.has(path.normalize(resourceDependency))`.\n\n### Minimal Reproduction\n\nRepro: https://github.com/te-gis-dev/ng-stale-template-diagnostics (`node repro.mjs` runs all steps against `ng serve` and restores the files).\n\nWith `@angular/build` 22.2.7, run `ng serve`, then:\n\n1. Append `\u003c/span>` to `src/app/app.html`. Expected `NG5002`; actual on Windows: build completes, no error.\n2. Revert, then append `\u003cp [attr.width.px]=\"1\">\u003c/p>`. Expected `NG8106` warning; actual on Windows: none.\n3. Add a blank line to `src/app/app.ts`. The missing diagnostics appear.\n\n| Setup | Stray `\u003c/span>` | `[attr.width.px]` |\n| --- | --- | --- |\n| 22.2.7, Windows 11, Node 26.12.1 | not reported | not reported |\n| 22.2.7, Linux (Docker `node:24`) | correct | correct |\n\n### Exception or Error\n\n```text\nWindows:\nApplication bundle generation complete.\n\nLinux:\n✘ [ERROR] NG5002: Unexpected closing tag \"span\". It may happen when the tag has already been closed by another tag. For more info see https://www.w3.org/TR/html5/syntax.html#closing-elements-that-have-implied-end-tags [plugin angular-compiler]\nApplication bundle generation failed.\n```\n\n### Your Environment\n\n```text\nAngular CLI : 22.2.7\nAngular : 22.2.6\nNode.js : 26.12.1\nPackage Manager : npm 11.16.0\nOperating System : win32 x64\n\n┌───────────────────────────┬───────────────────┬───────────────────┐\n│ Package │ Installed Version │ Requested Version │\n├───────────────────────────┼───────────────────┼───────────────────┤\n│ @angular/build │ 22.2.7 │ 22.2.7 │\n│ @angular/cli │ 22.2.7 │ 22.2.7 │\n│ @angular/common │ 22.2.6 │ 22.2.6 │\n│ @angular/compiler │ 22.2.6 │ 22.2.6 │\n│ @angular/compiler-cli │ 22.2.6 │ 22.2.6 │\n│ @angular/core │ 22.2.6 │ 22.2.6 │\n│ @angular/forms │ 22.2.6 │ 22.2.6 │\n│ @angular/platform-browser │ 22.2.6 │ 22.2.6 │\n│ @angular/router │ 22.2.6 │ 22.2.6 │\n│ rxjs │ 7.8.2 │ ~7.8.0 │\n│ typescript │ 6.0.3 │ 6.0.3 │\n└───────────────────────────┴───────────────────┴───────────────────┘\n```\n\n### Anything else relevant?\n\n- Windows only; drive-letter casing is not involved.\n- Latent on `main` / 22.3.0-rc.0: #34173 marks the component affected through Angular's incremental compilation first, but the lookup is still `false` on Windows. The check has never matched there since #25940.\n- On 22.2.x it also locks in the stale cached error fixed by #34173: while it is served, every template edit on Windows is ignored (`repro.mjs` steps 1-6).","author":{"url":"https://github.com/te-gis-dev","@type":"Person","name":"te-gis-dev"},"datePublished":"2026-11-16T08:29:52Z","url":"https://github.com/angular/angular-cli/issues/34725"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:449df589-dc53-5074-f2e7-d6d31fd2ea40 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8AA6:2C4BED:347FA55:42B6005:6B01DE7B |
| html-safe-nonce | 9a823ba6cb70fa3175bc1e7c7ffac00761ccf9a426207788d5a0033d2dccb104 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QUE2OjJDNEJFRDozNDdGQTU1OjQyQjYwMDU6NkIwMURFN0IiLCJ2aXNpdG9yX2lkIjoiODM4NTkyODE1MjY1NTk3ODEwNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 8454d6976b7968988ba21d1c2aff5e76a003fc2ff7ba1a0f8e067d03a597266b |
| hovercard-subject-tag | issue:6417310664 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular-cli/34725/issue_layout |
| twitter:image | https://opengraph.githubassets.com/19c3195aa5d2e4513c67f5cb9a1da4e6f33bfbabca523ea7e2dfccb419fffa2a/angular/angular-cli/issues/34725 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/19c3195aa5d2e4513c67f5cb9a1da4e6f33bfbabca523ea7e2dfccb419fffa2a/angular/angular-cli/issues/34725 |
| og:image:alt | Command serve 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 No response Description On Windows, during ng ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | te-gis-dev |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular-cli git https://github.com/angular/angular-cli.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 36891867 |
| octolytics-dimension-repository_nwo | angular/angular-cli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 36891867 |
| octolytics-dimension-repository_network_root_nwo | angular/angular-cli |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width