Skip to content

fix(sourcemap): Keep existing debug IDs with upload --no-rewrite - #2524

Merged
BYK merged 1 commit into
mainfrom
fix/sourcemap-no-rewrite-debug-ids
Nov 26, 2026
Merged

BYK merged 1 commit into
mainfrom
fix/sourcemap-no-rewrite-debug-ids

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

sentry sourcemap upload --no-rewrite sent every file without a debug ID, even when the JS already ends in //# debugId= or its map carries debug_id. Turbopack writes these natively, as do the bundler plugins and sourcemap inject. Without --release, Sentry then rejects the bundle ("uploading a bundle without debug ids or release is prohibited"), because no manifest entry has a debug-id header.

--no-rewrite now reads the IDs the pairs already carry, without touching the files, and sends them as debug-id headers on both the minified_source and source_map entries.

  • The ID comes from the JS //# debugId= comment, else the map's debug_id / debugId. Injection and inject --dry-run use the same order, and the dry run now shares the helper.
  • Legacy sentry-cli v3 reads each file's own ID and copies the map's ID onto the JS only with --debug-id-reference. v4 does that by default (see the migration guide), so a JS file without a comment takes its map's ID here too.
  • Pairs with no existing ID upload without one, as before.

Fixes #2500. Credit to @vibbix, who found the bug and traced it to the --no-rewrite branch.

via @BYK.

--

View Session [Sentry]

`sentry sourcemap upload --no-rewrite` sent every file without a debug ID,
even when the JS already ends in `//# debugId=` or its map carries
`debug_id`, as Turbopack and the bundler plugins write them. Without
`--release`, Sentry then rejects the bundle ("uploading a bundle without
debug ids or release is prohibited").

Read the IDs the pairs already carry, with the same precedence injection
uses (JS comment, then the map's `debug_id` / `debugId`), and send them
as `debug-id` headers. The files stay unchanged.

Fixes #2500

Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
@vercel

vercel Bot commented Nov 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cli Ready Ready Preview Nov 26, 2026 12:14pm UTC
1 Skipped Deployment
Project Deployment Actions Updated
sentry-local Skipped Skipped Nov 26, 2026 12:14pm UTC

Request Review

@sentry-junior
sentry-junior Bot requested a review from BYK November 26, 2026 12:14
@BYK
BYK marked this pull request as ready for review November 26, 2026 12:20
@BYK
BYK enabled auto-merge (squash) November 26, 2026 12:20
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Nov 26, 2026
@BYK
BYK merged commit eb20ed2 into main Nov 26, 2026
29 checks passed
@BYK
BYK deleted the fix/sourcemap-no-rewrite-debug-ids branch November 26, 2026 12:26

This branch was successfully deployed

1 active and 1 inactive deployments
Preview – cli — b8db7610 Deployed Nov 26, 2026 by vercel[bot]
Preview – sentry-local — b8db7610 Deployed Nov 26, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sentry sourcemap upload --no-rewrite drops debug IDs already in the files

1 participant