File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -196,9 +196,17 @@ function getSourcemappedFrameIfPossible(
196196 }
197197 sourceMapPayload = maybeSourceMapPayload
198198 try {
199+ // Pass the source map URL as the second parameter so that the consumer
200+ // can resolve relative paths in the source map's `sources` array.
201+ // This is important for Turbopack-generated source maps which use relative paths.
202+ // For most bundlers (Turbopack, Webpack), the source map is in a file with .map extension.
203+ // We don't have access to the actual sourceMappingURL from Node's findSourceMap API,
204+ // but this heuristic works for standard bundler output.
205+ const sourceMapURL = sourceURL + '.map'
199206 sourceMapConsumer = new SyncSourceMapConsumer (
200- // @ts -expect-error -- Module.SourceMap['version'] is number but SyncSourceMapConsumer wants a string
201- sourceMapPayload
207+ sourceMapPayload ,
208+ /** @ts -expect-error */
209+ sourceMapURL
202210 )
203211 } catch ( cause ) {
204212 // We should not log an actual error instance here because that will re-enter
You can’t perform that action at this time.
0 commit comments