Skip to content

Commit 03e10b7

Browse files
braebofuturGH
authored andcommitted
fix(ssr): print file url in ssrTransform parse error (vitejs#12060)
1 parent 39f2bf0 commit 03e10b7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/vite/src/node/ssr/ssrTransform.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ async function ssrTransformScript(
8080
if (!err.loc || !err.loc.line) throw err
8181
const line = err.loc.line
8282
throw new Error(
83-
`Parse failure: ${err.message}\nContents of line ${line}: ${
83+
`Parse failure: ${
84+
err.message
85+
}\nAt file: ${url}\nContents of line ${line}: ${
8486
code.split('\n')[line - 1]
8587
}`,
8688
)

0 commit comments

Comments
 (0)