diff --git a/packages/vite/src/node/ssr/ssrTransform.ts b/packages/vite/src/node/ssr/ssrTransform.ts index 5fe2272d7fa4f7..996d4411153dc8 100644 --- a/packages/vite/src/node/ssr/ssrTransform.ts +++ b/packages/vite/src/node/ssr/ssrTransform.ts @@ -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] }`, )