diff --git a/packages/next/src/server/patch-error-inspect.ts b/packages/next/src/server/patch-error-inspect.ts index 522e350f32c154..94d4ef1a7eda64 100644 --- a/packages/next/src/server/patch-error-inspect.ts +++ b/packages/next/src/server/patch-error-inspect.ts @@ -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