Skip to content

fix(sourcemaps): accept single-quoted and backticked ddDebugId values - #2539

Merged
Drarig29 merged 1 commit into
DataDog:masterfrom
ilteoood:ilteoood/fix-528-backticked-debug-id
Oct 2, 2026
Merged

Drarig29 merged 1 commit into
DataDog:masterfrom
ilteoood:ilteoood/fix-528-backticked-debug-id

Conversation

@ilteoood

@ilteoood ilteoood commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Mirrors DataDog/build-plugins#529.

Sourcemap upload fails with No debug ID found in any minified file. Aborting upload. even when the bundled output contains the ddDebugId literal.

Root cause

Some minifiers emit the injected value wrapped in single quotes or backticks rather than the double quotes produced by JSON.stringify(...). Examples include:

  • ddDebugId:'<uuid>' (single-quoted string)
  • ddDebugId:`` (template-literal-style string)
  • "ddDebugId":'<uuid>' (mixed)

The previous extraction regex only accepted double quotes around the value, so any bundle emitted with a different quote style failed extraction and aborted the upload.

Change

In packages/base/src/commands/sourcemaps/debugId.ts, broaden the value portion of DEBUG_ID_REGEX to accept ", ' and ` while keeping the existing flexibility around the optional quotes on the key, and use a backreference so the closing quote must match the opening quote:

// Before
const DEBUG_ID_REGEX = /"?ddDebugId"?:"([0-9a-fA-F-]{36})"/;
// After
const DEBUG_ID_REGEX = /"?ddDebugId"?:(["'`])([0-9a-fA-F-]{36})\1/;

Added four regression tests in debugId.test.ts:

  • unquoted key with single-quoted value (ddDebugId:'<uuid>')
  • quoted key with single-quoted value ("ddDebugId":'<uuid>')
  • unquoted key with backticked value (ddDebugId:``)
  • mismatched quotes returns undefined (ddDebugId:'<uuid>")

Verification

  • yarn test packages/base/src/commands/sourcemaps — 116 tests across 6 suites pass (includes 4 new tests in debugId.test.ts)
  • yarn build — clean
  • yarn format — clean (no format changes needed)

Some minifiers wrap the ddDebugId value in single quotes (e.g. ddDebugId:'<uuid>')
or backticks (e.g. ddDebugId:`<uuid>`) instead of the double quotes produced by
JSON.stringify(...). The previous regex only accepted double quotes around the
value, so any bundle emitted with a different quote style failed extraction and
triggered 'No debug ID found in any minified file. Aborting upload.' during
sourcemap upload.

Broaden the value quotes in DEBUG_ID_REGEX to ['"'``] and backreference the
opening quote so the closing quote must match. Mirrors the change from
DataDog/build-plugins#529.

Signed-off-by: Corentin Girard <corentin.girard@datadoghq.com>
@ilteoood
ilteoood requested review from a team as code owners October 2, 2026 06:39

@jhssilva jhssilva left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@datadog-prod-us1-5

datadog-prod-us1-5 Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Tests

✅ All CI checks and tests passed.

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: a73a338 | Docs | View more details | Give us feedback!

@Drarig29 Drarig29 added the rum Related to [dsyms, flutter-symbols, react-native, sourcemaps, unity-symbols] label Oct 2, 2026
@Drarig29
Drarig29 force-pushed the ilteoood/fix-528-backticked-debug-id branch from 103ed88 to a73a338 Compare October 2, 2026 10:47
@Drarig29

Drarig29 commented Oct 2, 2026 •

Copy link
Copy Markdown
Collaborator

@ilteoood I had to force-push your branch to sign your commits (required by our CI)

Thanks for the contribution!

@Drarig29
Drarig29 merged commit a29a1a3 into DataDog:master Oct 2, 2026
35 checks passed
@ilteoood

ilteoood commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

@ilteoood I had to force-push your branch to sign your commits (required by our CI)

Thanks for the contribution!

No worries, thank you

@ilteoood
ilteoood deleted the ilteoood/fix-528-backticked-debug-id branch October 2, 2026 11:47
@Drarig29 Drarig29 mentioned this pull request Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rum Related to [dsyms, flutter-symbols, react-native, sourcemaps, unity-symbols]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants