Skip to content

fix: Use build directory for web debug ID injection#412

Draft
buenaflor wants to merge 2 commits into
mainfrom
buenaflor/fix/web-inject-use-directory
Draft

fix: Use build directory for web debug ID injection#412
buenaflor wants to merge 2 commits into
mainfrom
buenaflor/fix/web-inject-use-directory

Conversation

@buenaflor

Copy link
Copy Markdown
Contributor

Pass the web build folder directly to sentry-cli sourcemaps inject instead of enumerating each .js file 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 _findAllJsFilePaths enumeration and the associated TODO.

Behavior preserved/improved:

  • ignore_web_source_paths is 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-empty is 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).
  • Injection is skipped (and source map upload along with it) when the web build directory does not exist, preserving the previous "no web build -> skip" behavior that the per-file empty check provided.

Changelog Entry

Use the build directory for web debug ID injection instead of injecting each file individually, and honor ignore_web_source_paths during injection.

Made with Cursor

buenaflor and others added 2 commits June 11, 2026 14:19
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant