mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 23:22:02 +00:00
fix(vite): include id and stack in vite-node
fallback error handler (#7575)
Co-authored-by: Pooya Parsa <pooya@pi0.io>
This commit is contained in:
parent
cfaca9c5c7
commit
5bc654495a
@ -48,13 +48,14 @@ function createRunner () {
|
|||||||
message,
|
message,
|
||||||
stack
|
stack
|
||||||
})
|
})
|
||||||
} catch (err) {
|
} catch (formatError) {
|
||||||
// This should not happen unless there is an internal error with formatViteError!
|
consola.warn('Internal nuxt error while formatting vite-node error. Please report this!', formatError)
|
||||||
consola.error('Error while formatting vite error:', errorData)
|
const message = `[vite-node] [TransformError] ${errorData?.message || '-'}`
|
||||||
|
consola.error(message, errorData)
|
||||||
throw createError({
|
throw createError({
|
||||||
statusMessage: 'Vite Error',
|
statusMessage: 'Vite Error',
|
||||||
message: errorData.message || 'Vite Error',
|
message,
|
||||||
stack: 'Vite Error\nat [check console]'
|
stack: `${message}\nat ${id}\n` + (errorData?.stack || '')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
throw _err
|
throw _err
|
||||||
|
Loading…
Reference in New Issue
Block a user