mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 13:45:18 +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,
|
||||
stack
|
||||
})
|
||||
} catch (err) {
|
||||
// This should not happen unless there is an internal error with formatViteError!
|
||||
consola.error('Error while formatting vite error:', errorData)
|
||||
} catch (formatError) {
|
||||
consola.warn('Internal nuxt error while formatting vite-node error. Please report this!', formatError)
|
||||
const message = `[vite-node] [TransformError] ${errorData?.message || '-'}`
|
||||
consola.error(message, errorData)
|
||||
throw createError({
|
||||
statusMessage: 'Vite Error',
|
||||
message: errorData.message || 'Vite Error',
|
||||
stack: 'Vite Error\nat [check console]'
|
||||
message,
|
||||
stack: `${message}\nat ${id}\n` + (errorData?.stack || '')
|
||||
})
|
||||
}
|
||||
throw _err
|
||||
|
Loading…
Reference in New Issue
Block a user