Repository navigation
fix(@angular/build): attach location to Sass errors and guard stack parsing - #34423
Conversation
…arsing Populate the structured esbuild `location` on Sass `Exception` errors using a shared `spanToLocation` helper (matching Sass warnings) so that failed stylesheet files are tracked on error messages. Also add a bounds check on `index < segments.length` in `extractFilesFromStack` to avoid throwing a `TypeError` when a stack trace line does not contain a `line:col` segment.
There was a problem hiding this comment.
Code Review
This pull request refactors Sass error handling in the Angular build tool by extracting location mapping into a helper function and populating structured location details for compilation errors. It also adds bounds checks when parsing Sass stack traces and introduces comprehensive unit tests. Feedback on these changes highlights a bug where file paths containing spaces are incorrectly reconstructed without spaces, and suggests ensuring that the file path resolves to undefined instead of null to match esbuild's expected types.
|
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
locationon SassExceptionerrors via a sharedspanToLocationhelper (matching Sass warnings) soBundlerContext.#addErrorsToWatchcan track failed.scssfiles even when#loadCacheis disabled.index < segments.length) inextractFilesFromStackand skip stack trace lines without aline:colsegment to preventTypeError: Cannot read properties of undefined (reading 'match').