Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Commit

Permalink
fix(vite): include id and stack in vite-node fallback error handler (
Browse files Browse the repository at this point in the history
…#7575)

Co-authored-by: Pooya Parsa <pooya@pi0.io>
  • Loading branch information
danielroe and pi0 committed Sep 16, 2022
1 parent cfaca9c commit 5bc6544
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions packages/vite/src/runtime/vite-node.mjs
Expand Up @@ -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
Expand Down

0 comments on commit 5bc6544

Please sign in to comment.