Skip to content

Commit

Permalink
Prefer url.fileURLToPath
Browse files Browse the repository at this point in the history
Co-authored-by: Hendrik Liebau <mail@hendrik-liebau.de>
  • Loading branch information
eps1lon and unstubbable committed Oct 28, 2024
1 parent 30fac24 commit e9e1eff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/next/src/server/patch-error-inspect.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { findSourceMap, type SourceMapPayload } from 'module'
import * as path from 'path'
import { URL } from 'url'
import * as url from 'url'
import type * as util from 'util'
import { SourceMapConsumer as SyncSourceMapConsumer } from 'next/dist/compiled/source-map'
import type { StackFrame } from 'next/dist/compiled/stacktrace-parser'
Expand Down Expand Up @@ -38,7 +38,7 @@ function frameToString(frame: StackFrame): string {
// In a multi-app repo, this leads to potentially larger file names but will make clicking snappy.
// There's no tradeoff for the cases where `dir` in `next dev [dir]` is omitted
// since relative to cwd is both the shortest and snappiest.
path.relative(process.cwd(), new URL(frame.file).pathname)
path.relative(process.cwd(), url.fileURLToPath(frame.file))
: frame.file

return frame.methodName
Expand Down

0 comments on commit e9e1eff

Please sign in to comment.