Repository navigation
fix(sourcemaps): accept single-quoted and backticked ddDebugId values - #2539
Merged
Drarig29 merged 1 commit intoOct 2, 2026
Merged
Conversation
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>
amortemousque
approved these changes
Oct 2, 2026
Drarig29
approved these changes
Oct 2, 2026
|
✅ All CI checks and tests passed. 🎉 All green!🧪 All tests passed 🔗 Commit SHA: a73a338 | Docs | View more details | Give us feedback! |
Drarig29
force-pushed
the
ilteoood/fix-528-backticked-debug-id
branch
from
October 2, 2026 10:47
103ed88 to
a73a338
Compare
Collaborator
|
@ilteoood I had to force-push your branch to sign your commits (required by our CI) Thanks for the contribution! |
Contributor
Author
No worries, thank you |
Merged
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.
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 theddDebugIdliteral.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 ofDEBUG_ID_REGEXto 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:Added four regression tests in
debugId.test.ts:ddDebugId:'<uuid>')"ddDebugId":'<uuid>')ddDebugId:``)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— cleanyarn format— clean (no format changes needed)