Skip to content

Commit

Permalink
fix(ssr): print file url in ssrTransform parse error (#12060)
Browse files Browse the repository at this point in the history
  • Loading branch information
braebo authored Feb 17, 2023
1 parent f2a5fcc commit 19f39f7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/vite/src/node/ssr/ssrTransform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ async function ssrTransformScript(
if (!err.loc || !err.loc.line) throw err
const line = err.loc.line
throw new Error(
`Parse failure: ${err.message}\nContents of line ${line}: ${
`Parse failure: ${
err.message
}\nAt file: ${url}\nContents of line ${line}: ${
code.split('\n')[line - 1]
}`,
)
Expand Down

0 comments on commit 19f39f7

Please sign in to comment.