Repository navigation
fix(@angular/build): use component file path in inline stylesheet diagnostic locations - #34427
Open
alan-agius4 wants to merge 3 commits into
Open
alan-agius4 wants to merge 3 commits into
alan-agius4 wants to merge 3 commits into
Conversation
…gnostic locations Rewrite internal angular:styles/component:<lang>;<hash>;<filename> virtual URIs in inline component stylesheet error, warning, and note locations to the component's file path, and ensure the component file path is added to watchFiles on error.
alan-agius4
marked this pull request as ready for review
October 20, 2026 09:33
There was a problem hiding this comment.
Code Review
This pull request updates the ComponentStylesheetBundler to map virtual URIs (starting with 'angular:styles/component:') in esbuild error and warning locations back to the actual component filename, and adds corresponding unit tests. A review comment correctly identifies a potential runtime TypeError if 'file' is undefined when calling 'startsWith()', as well as potential iteration errors if 'notes' is undefined. It is recommended to apply the suggested optional chaining and nullish coalescing fixes.
…eet diagnostic locations
…eet diagnostic locations
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.
Summary
ComponentStylesheetBundler.bundleInline, esbuild attaches the virtual URIangular:styles/component:<lang>;<hash>;<filename>aslocation.fileon syntax and resolution diagnostics.location.filestarting withangular:styles/component:on errors, warnings, and their notes tofilename, and record the component file inbundlerContext.watchFileswhen errors occur.Testing
component-stylesheets_spec.tsverifying that inline stylesheet errors and warnings report the component filename instead of the internalangular:styles/component:virtual URI.