Repository navigation
feat(sourcemap): Add wasm sourcemap support for inject and upload - #1629
Draft
sentry-junior[bot] wants to merge 1 commit into
Draft
sentry-junior[bot] wants to merge 1 commit into
sentry-junior[bot] wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
sentry-junior
Bot
force-pushed
the
port/cli-1588-wasm-sourcemaps
branch
from
October 23, 2026 13:39
a3b4624 to
9a44113
Compare
`sourcemap inject` and `sourcemap upload` only discovered `.js`, `.cjs`, and `.mjs`, so the `app.wasm.map` Emscripten writes with `-gsource-map` never reached Sentry. Even when it did, nothing linked it to its module: events identify a wasm module by its `build_id` custom section, while sourcemaps match by the `debug_id` inside the map JSON. Both commands now handle `<stem>.wasm` + `<stem>.wasm.map` pairs next to JS pairs. The module's `build_id` is the source of truth. The CLI formats it as a dashed UUID and writes it onto the map as `debug_id`/`debugId`, stamping a random `build_id` first when the module has none. The module is never read as text. Running it again changes nothing, and if the map already has a different id, the module's id replaces it. `upload` sends the module as `minified_source` and the map as `source_map` under that id. `*.debug.wasm` companions are skipped because `debug-files wasm-upload` owns them. Build id stamping moves to `lib/wasm/stamp.ts` so `wasm-upload` and the sourcemap path share one rule. Ported from getsentry/cli#1588, which is being closed with the repo archive. Stacked on the getsentry/cli#1572 port.
sentry-junior
Bot
force-pushed
the
port/cli-1588-wasm-sourcemaps
branch
from
October 23, 2026 14:03
9a44113 to
39c9a29
Compare
This branch was previously deployed
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.
Ported from getsentry/cli#1588 by @d2anamaria, which is being closed as part of the
getsentry/cliarchive. This PR is stacked on #1628 (the port of cli#1572) and should merge after it. It is a draft because the original was a draft, and nobody had reviewed it yet.Problem
sentry sourcemap injectandsentry sourcemap uploadonly look for.js,.cjs, and.mjsfiles. When Emscripten builds with-gsource-map, it writes anapp.wasm.mapfile, and these commands never upload it. Even when the map gets to Sentry some other way, nothing links it to its module. Events identify a wasm module by itsbuild_idcustom section, but uploaded sourcemaps are matched by thedebug_idinside the map JSON.Solution
Both commands now handle
<stem>.wasm+<stem>.wasm.mappairs next to JavaScript pairs.build_iddecides the id. The CLI formats it as a dashed UUID and writes it into the map asdebug_id/debugId.build_idgets a random one first.uploadsends the module asminified_sourceand the map assource_map, both under the same id.--url-prefix,--strip-prefix,--strip-common-prefix,--release, and--distall work for these pairs.*.debug.wasmcompanions are skipped, becausedebug-files wasm-uploaduploads them.Build-id stamping moves to
lib/wasm/stamp.ts, sowasm-uploadand the sourcemap path follow the same rule.Port notes
--strip-common-prefixstill handles inline maps.setSourcemapDebugIdcalls toolkit'smutateSourcemapwithoutsnippetLine, somappingsare not shifted. In the original PR this was theoffsetMappings: falseoption.addWasmDiscoveryCountsignores--ignore/--ignore-file. If a directory's only.wasmfiles are ignored, the error message about missing maps can be misleading.--dry-run, wasm pairs show as unchanged even when the command would stamp them, becausemapWrittenandmoduleStampedare never set during a dry run.sourceMappingURLsection is not parsed.Validation
tsc --noEmitforpackages/clivitestacrosstest/lib/wasm,test/commands/debug-files,test/commands/sourcemap,test/lib/sourcemap,test/lib/scan: 593 tests passedoxlintandoxfmt --checkforpackages/cligenerate:docsleaves no diffRefs getsentry/cli#1588
via BYK.
--
View Junior Session in Sentry