diff --git a/packages/vite/src/runtime/vite-node.mjs b/packages/vite/src/runtime/vite-node.mjs index 8bc19332cc0..dab7b3d5a1b 100644 --- a/packages/vite/src/runtime/vite-node.mjs +++ b/packages/vite/src/runtime/vite-node.mjs @@ -46,9 +46,10 @@ function createRunner () { if (!errorData) { throw err } + let _err try { const { message, stack } = formatViteError(errorData) - throw createError({ + _err = createError({ statusMessage: 'Vite Error', message, stack @@ -62,6 +63,7 @@ function createRunner () { stack: 'Vite Error\nat [check console]' }) } + throw _err }) } })