Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon committed Oct 23, 2024
1 parent 052ce12 commit 4e87b84
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions packages/next/src/server/patch-error-inspect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ function prepareUnsourcemappedStackTrace(
function shouldIgnoreListByDefault(file: string): boolean {
return (
// TODO: Solve via `ignoreList` instead. Tricky because node internals are not part of the sourcemap.
file.startsWith('node:') ||
file.startsWith('node:')
// C&P from setup-dev-bundler
// TODO: Taken from setup-dev-bundler but these seem too broad
// file.includes('web/adapter') ||
// file.includes('web/globals') ||
// file.includes('sandbox/context') ||
// TODO: Seems too aggressive?
file.includes('<anonymous>') ||
file.startsWith('eval')
// file.includes('<anonymous>') ||
// file.startsWith('eval')
)
}

Expand Down Expand Up @@ -108,12 +108,14 @@ function getSourcemappedFrameIfPossible(
arguments: [],
}

const codeFrame =
process.env.NODE_ENV !== 'production'
? getOriginalCodeFrame(originalFrame, sourceContent)
: null

return {
stack: originalFrame,
code:
process.env.NODE_ENV !== 'production'
? getOriginalCodeFrame(originalFrame, sourceContent)
: null,
code: codeFrame,
}
}

Expand Down

0 comments on commit 4e87b84

Please sign in to comment.