fix: Use build directory for web debug ID injection#412
Draft
buenaflor wants to merge 2 commits into
Draft
Conversation
Pass the web build folder directly to `sentry-cli sourcemaps inject` instead of enumerating each `.js` file. The previous per-file workaround existed because of a sentry-cli bug that corrupted Flutter Web source maps; that bug was fixed in sentry-cli 2.58.6 (shipped in 3.4.0). Honors `ignore_web_source_paths` during injection via `--ignore` so ignored files are no longer mutated in-place (consistent with upload), adds `--allow-empty` to avoid erroring on builds without source maps, and skips injection when the web build directory does not exist. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Pass the web build folder directly to
sentry-cli sourcemaps injectinstead of enumerating each.jsfile and passing them individually.The per-file approach was a workaround for a sentry-cli bug that corrupted Flutter Web source maps when injecting against a directory. That bug was fixed in sentry-cli 2.58.6 (shipped in 3.4.0), so we can now rely on the directory form, which removes the
_findAllJsFilePathsenumeration and the associated TODO.Behavior preserved/improved:
ignore_web_source_pathsis now honored during injection via--ignore, so ignored files are no longer mutated in-place. Patterns are gitignore-style globs interpreted relative to the web build folder, matching the existing upload step.--allow-emptyis passed so a build that contains no source maps no longer hard-errors (sentry-cli errors by default when no JS + sourcemap pairs are found).Changelog Entry
Use the build directory for web debug ID injection instead of injecting each file individually, and honor
ignore_web_source_pathsduring injection.Made with Cursor