fix(debugger): apply source maps to probe stack traces#7336
Conversation
Overall package sizeSelf size: 4.49 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 2.0.3 | 76.87 kB | 808.03 kB | | dc-polyfill | 0.1.10 | 26.73 kB | 26.73 kB |🤖 This report was automatically generated by heaviest-objects-in-the-universe |
|
BenchmarksBenchmark execution time: 2026-01-30 13:34:02 Comparing candidate commit d6699b7 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 228 metrics, 32 unstable metrics. |
88c9de7 to
e7b2698
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7336 +/- ##
=======================================
Coverage 85.86% 85.86%
=======================================
Files 518 518
Lines 22374 22374
=======================================
Hits 19211 19211
Misses 3163 3163 Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
e7b2698 to
66efe77
Compare
When a probe is hit, stack traces now correctly show original source file locations (e.g., TypeScript files) instead of transpiled code, matching the behavior of breakpoint locations. Added async source map transformation to getStackFromCallFrames using the existing SourceMapConsumer.originalPositionFor method. Stack frames gracefully fall back to generated positions if transformation fails.
Address PR review feedback: - Remove unused _scriptSourceMaps test exposure (not used in tests) - Move getOriginalPosition to module-level import alongside loadSourceMapSync, eliminating all runtime overhead from lazy loading since the module was already imported Tests: All 82 tests in state.spec.js pass
66efe77 to
d6699b7
Compare
BridgeAR
left a comment
There was a problem hiding this comment.
The code itself is LGTM. I did not closely look at the tests.
When a probe is hit, stack traces now correctly show original source file locations (e.g., TypeScript files) instead of transpiled code, matching the behavior of breakpoint locations. Added async source map transformation to getStackFromCallFrames using the existing SourceMapConsumer.originalPositionFor method. Stack frames gracefully fall back to generated positions if transformation fails.
When a probe is hit, stack traces now correctly show original source file locations (e.g., TypeScript files) instead of transpiled code, matching the behavior of breakpoint locations. Added async source map transformation to getStackFromCallFrames using the existing SourceMapConsumer.originalPositionFor method. Stack frames gracefully fall back to generated positions if transformation fails.
When a probe is hit, stack traces now correctly show original source file locations (e.g., TypeScript files) instead of transpiled code, matching the behavior of breakpoint locations. Added async source map transformation to getStackFromCallFrames using the existing SourceMapConsumer.originalPositionFor method. Stack frames gracefully fall back to generated positions if transformation fails.

What does this PR do?
Fixes probe stack traces to correctly show original source file locations when source maps are available. Previously, stack traces in probe snapshots displayed transpiled/generated code locations instead of the original source locations (e.g., TypeScript files), while breakpoint locations were correctly mapped.
Motivation
When a Dynamic Instrumentation probe is hit in transpiled code, developers need to see stack traces that reference their original source files, not the generated JavaScript. This was already working correctly for breakpoint locations but not for the stack traces in the snapshots, making it difficult to debug transpiled applications.