Skip to content

Commit

Permalink
fix source map for dev overlay for turbopack
Browse files Browse the repository at this point in the history
  • Loading branch information
gaojude committed Feb 3, 2025
1 parent bab37ff commit a487592
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -291,11 +291,16 @@ async function createOriginalStackFrame(
project: Project,
frame: TurbopackStackFrame
): Promise<OriginalStackFrameResponse | null> {
const traced =
(await nativeTraceSource(frame)) ??
// TODO(veil): When would the bundler know more than native?
// If it's faster, try the bundler first and fall back to native later.
(await batchedTraceSource(project, frame))
let traced
try {
traced = await nativeTraceSource(frame)
} catch {
// Try native source tracing first as a performance optimization.
// This will fail for bundler-specific URLs (e.g. turbopack://) which is expected,
// so we catch and fallback to the slower but more robust batch tracing.
}
traced = traced ?? (await batchedTraceSource(project, frame))

if (!traced) {
return null
}
Expand Down

0 comments on commit a487592

Please sign in to comment.