Repository navigation
Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/browser
SDK Version
11.11.0 (@sentry/browser, @sentry/wasm); 5.4.1 (@sentry/vite-plugin)
Framework Version
No response
Link to Sentry event
https://medmunds.sentry.io/issues/7834537385/events/147e4b1014e14ded8a52603555cab96a/
Reproduction Example/SDK Setup
Init:
- Main thread: https://github.com/medmunds/puzzles-web/blob/main/src/utils/sentry.ts#L19
- Worker thread + wasm integration: https://github.com/medmunds/puzzles-web/blob/main/src/puzzle/worker.ts#L5-L11
- sentryVitePlugin: https://github.com/medmunds/puzzles-web/blob/main/vite.config.ts#L352-L371
Steps to Reproduce
-
Create a JS app with a function that includes
(in the name. E.g.,methodCaller< (emscripten::val) => void>, which is the actual name of an Emscripten-generated wasm-to-JS bridge function.Note that Emscripten with
-sDYNAMIC_EXECUTION=0generates thesemethodCallerbridge functions and sets their names to show the full C method signature.For testing purposes, you can skip the whole Emscripten/wasm toolchain and just mimic what Emscripten does:
function methodCaller(val) { throw new Error("test error"); } Object.defineProperty(methodCaller, "name", { value: "methodCaller< (emscripten::val) => void>" });
-
Build your app and upload sourcemaps to Sentry. (I'm using
@sentry/vite-plugin, but I don't think it's relevant to the issue.) -
Cause an exception to be logged while that function is on the stack.
-
Examine the recorded stack trace in Sentry.
Here's an actual raw stack trace that Sentry has trouble parsing. Note the methodCaller frame:
TypeError: Cannot create property 'imageData' on boolean 'false'
at Drawing.blitterFree (../src/puzzle/drawing.ts:273:13)
at methodCaller< (emscripten::val) => void> (https://puzzles.twistymaze.com/assets/worker-BBxJRpa6.js:1:43074)
at wasmImports._emval_invoke (../src/assets/puzzles/emcc-runtime.js:1:52388)
inertia-BCZY8y8t.wasm0x2299c null (/assets/inertia-BCZY8y8t.wasm)
inertia-BCZY8y8t.wasm0x194cc null (/assets/inertia-BCZY8y8t.wasm)
inertia-BCZY8y8t.wasm0x1bfd1 null (/assets/inertia-BCZY8y8t.wasm)
inertia-BCZY8y8t.wasm0x13ad6 null (/assets/inertia-BCZY8y8t.wasm)
inertia-BCZY8y8t.wasm0x21703 null (/assets/inertia-BCZY8y8t.wasm)
inertia-BCZY8y8t.wasm0x216b4 null (/assets/inertia-BCZY8y8t.wasm)
at Frontend.size (../src/assets/puzzles/emcc-runtime.js:1:21293)
at WorkerPuzzle.size (../src/puzzle/worker.ts:241:26)
at callback (../node_modules/.pnpm/comlink@4.4.2/node_modules/comlink/dist/esm/comlink.mjs:103:48)
Expected Result
Sentry should be able to parse the correct filename from the stack trace (https://puzzles.twistymaze.com/assets/worker-BBxJRpa6.js in the trace above example above).
And Sentry should be able to link the stack frame back to the uploaded sourcemap by debug id.
Actual Result
Sentry incorrectly parses the filename as everything between the outermost (...) on a stack frame line. (In the example above, it thinks the filename/uri is emscripten::val) => void> (https://puzzles.twistymaze.com/assets/worker-BBxJRpa6.js.)
Additional Context
#26202 is essentially the same issue in @sentry/node. This part of stack parsing is not shared between @sentry/browser and @sentry/node, so I've opened this as a separate issue against @sentry/browser.
The example event here originated in Chrome Mobile WebView 150.0.7871 Android 13, but the stack parsers for all browsers should be reviewed as they seem to use similar regex captures.
(If there is other textual stack trace parsing elsewhere in Sentry, it would be a good idea to review it for similar problems on any platforms where displayed function names can be set to arbitrary strings.)
Priority
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it.
Activity
linear-code commentedon Nov 8, 2026
JS-4089