Repository navigation
fix(@angular/build): attach location to Sass errors and guard stack parsing - #34423
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
…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.
alan-agius4
marked this pull request as ready for review
October 20, 2026 09:21
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 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
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').