Repository navigation
fix(@angular/build): use component file path in inline stylesheet diagnostic locations - #34427
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.
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 pull request has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
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.