fix(vite): show formatted vite-node errors (#7509)

This commit is contained in:
pooya parsa 2022-09-14 17:58:28 +02:00 committed by GitHub
parent e822c02cdc
commit 326d62803b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -46,9 +46,10 @@ function createRunner () {
if (!errorData) { if (!errorData) {
throw err throw err
} }
let _err
try { try {
const { message, stack } = formatViteError(errorData) const { message, stack } = formatViteError(errorData)
throw createError({ _err = createError({
statusMessage: 'Vite Error', statusMessage: 'Vite Error',
message, message,
stack stack
@ -62,6 +63,7 @@ function createRunner () {
stack: 'Vite Error\nat [check console]' stack: 'Vite Error\nat [check console]'
}) })
} }
throw _err
}) })
} }
}) })