fix(instrumentation): avoid rewriter source map marker in source#9212
Conversation
source-map-support scans loaded files for the last source map marker. The rewriter template literal looked like this file's own inline map under pm2, so reading an error stack from the rewriter decoded the placeholder as base64 and threw from Error.prepareStackTrace. Fixes: #9206
Overall package sizeSelf size: 6.71 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.3.1 | 122.62 kB | 437.94 kB | | opentracing | 0.14.7 | 194.81 kB | 194.81 kB | | dc-polyfill | 0.1.11 | 25.74 kB | 25.74 kB |🤖 This report was automatically generated by heaviest-objects-in-the-universe |
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: 85e3796 | Docs | Datadog PR Page | Give us feedback! |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #9212 +/- ##
==========================================
+ Coverage 93.96% 96.56% +2.60%
==========================================
Files 917 918 +1
Lines 121523 121564 +41
Branches 19548 20868 +1320
==========================================
+ Hits 114188 117394 +3206
+ Misses 7335 4170 -3165
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
BenchmarksBenchmark execution time: 2026-07-10 00:02:20 Comparing candidate commit 85e3796 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 2315 metrics, 43 unstable metrics.
|
| } | ||
|
|
||
| // Keep the marker split: source-map scanners can read a contiguous token in | ||
| // string literals as this file's own inline map. |
There was a problem hiding this comment.
This is nuts because it's not technically within a comment, but oh well. I guess they're not using a real parser.
There was a problem hiding this comment.
Yes... and it is sadly not only that one tool. It is even how it is implemented in chromium
|
this should also fix #9260 right? |
source-map-support scans loaded files for the last source map marker. The rewriter template literal looked like this file's own inline map under pm2, so reading an error stack from the rewriter decoded the placeholder as base64 and threw from Error.prepareStackTrace. Fixes: #9206 Co-authored-by: Roch Devost <[email protected]>
source-map-support scans loaded files for the last source map marker. The rewriter template literal looked like this file's own inline map under pm2, so reading an error stack from the rewriter decoded the placeholder as base64 and threw from Error.prepareStackTrace. Fixes: #9206 Co-authored-by: Roch Devost <[email protected]>
source-map-support scans loaded files for the last source map marker. The rewriter template literal looked like this file's own inline map under pm2, so reading an error stack from the rewriter decoded the placeholder as base64 and threw from Error.prepareStackTrace. Fixes: #9206 Co-authored-by: Roch Devost <[email protected]>
source-map-support scans loaded files for the last source map marker. The rewriter template literal looked like this file's own inline map under pm2, so reading an error stack from the rewriter decoded the placeholder as base64 and threw from Error.prepareStackTrace. Fixes: #9206 Co-authored-by: Roch Devost <[email protected]>
Summary
source-map-support scans loaded files for the last source map marker. The rewriter template literal looked like this file's own inline map under pm2, so reading an error stack from the rewriter decoded the placeholder as base64 and threw from Error.prepareStackTrace.
Fixes: #9206