Repository navigation
fix(@angular/build): refresh template diagnostics on Windows after an external template changes - #34736
Open
thekhegay wants to merge 2 commits into
Open
fix(@angular/build): refresh template diagnostics on Windows after an external template changes#34736thekhegay wants to merge 2 commits into
thekhegay wants to merge 2 commits into
Conversation
… external template changes On Windows the modified files are normalized to backslash paths while component resource dependencies use forward slashes, so the lookup never matched and the cached Angular diagnostics of the component were kept.
There was a problem hiding this comment.
Code Review
This pull request updates the AotCompilation class in aot-compilation.ts to import and use the normalize function from node:path when checking resource dependencies. This ensures path separator consistency, particularly on Windows platforms. There are no review comments, so I have no feedback to provide.
alan-agius4
reviewed
Nov 17, 2026
| for (const resourceDependency of resourceDependencies) { | ||
| if ( | ||
| !hostOptions.modifiedFiles.has(resourceDependency) || | ||
| // modifiedFiles holds normalized paths, so the separators differ on Windows |
Collaborator
There was a problem hiding this comment.
The comment here is not true. modifiedFiles can be posix paths on Windows.
Contributor
Author
There was a problem hiding this comment.
Right, removed it. Since set can hold both forms it now checks resource path as is and normalized
alan-agius4
requested changes
Nov 17, 2026
…fter an external template changes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Checklist
PR Type
What is the current behavior?
Issue Number: #34725
On Windows
SourceFileCache.invalidateputspath.normalized paths (backslashes) intomodifiedFiles, but resource dependencies from compiler have forward slashes. SomodifiedFiles.has(resourceDependency)inAotCompilationnever matches, diagnostics cache of the component is not dropped and template errors stay stale after editing external templateWhat is the new behavior?
Resource dependency is normalized before the lookup, same as
referencedFilesare normalized inSourceFileCache.invalidate. On POSIXnormalizedoesnt change anythingDoes this PR introduce a breaking change?
Other information
No test: mismatch only happens with Windows separators, cant reproduce it on Linux/macOS. Issue has repro repo with output from both platforms