CLI Version
3.3.3
Operating System and Architecture
Operating System Version
macOS 15.3, Debian 12 (node:24 Docker image)
Link to reproduction repository
See test here https://github.com/getsentry/sentry-cli/pull/3243/changes#diff-875ee27ec59c83f8fd42c15616c5baa3ba37041f06524816921a3b2ad14fcb70
CLI Command
sentry-cli sourcemaps inject ./my-dist
Exact Reproduction Steps
Reproduction Steps
- Bundle a JS worker that includes terser or babel as dependencies (these tools generate sourceMappingURL comments as part of their output)
- After minification, template literals in these tools produce lines like:
var output=code+`
//# sourceMappingURL=data:application/json;base64,`+btoa(map)
- The backtick preserves the newline, so
//# sourceMappingURL=data:application/json;base64, lands at column 0
discover_sourcemaps_location matches it as a real directive, but the "base64" content is JS code, so decoding fails
- Run
sentry-cli sourcemaps inject ./my-dist
Expected Results
The injection skips files where the embedded sourcemap data isn't valid base64 and processes the rest normally.
Actual Results
> Searching ./my-dist
> Found 236 files
> Analyzing 236 sources
> Injecting debug ids
error: Invalid embedded sourcemap in source file ./my-dist/assets/bundler.worker-CqhnNlN9.js
Exits with code 1, no other files are processed.
Logs
N/A
CLI Version
3.3.3
Operating System and Architecture
Operating System Version
macOS 15.3, Debian 12 (node:24 Docker image)
Link to reproduction repository
See test here https://github.com/getsentry/sentry-cli/pull/3243/changes#diff-875ee27ec59c83f8fd42c15616c5baa3ba37041f06524816921a3b2ad14fcb70
CLI Command
sentry-cli sourcemaps inject ./my-dist
Exact Reproduction Steps
Reproduction Steps
//# sourceMappingURL=data:application/json;base64,lands at column 0discover_sourcemaps_locationmatches it as a real directive, but the "base64" content is JS code, so decoding failssentry-cli sourcemaps inject ./my-distExpected Results
The injection skips files where the embedded sourcemap data isn't valid base64 and processes the rest normally.
Actual Results
Exits with code 1, no other files are processed.
Logs
N/A