mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 05:35:13 +00:00
fix(vite): normalize vite-node error data from server (#7589)
This commit is contained in:
parent
2b57bfe36c
commit
cfaca9c5c7
@ -113,7 +113,13 @@ function createViteNodeMiddleware (ctx: ViteBuildContext, invalidates: Set<strin
|
||||
throw createError({ statusCode: 400 })
|
||||
}
|
||||
const module = await node.fetchModule(moduleId).catch((err) => {
|
||||
throw createError({ data: err })
|
||||
const errorData = {
|
||||
code: 'VITE_ERROR',
|
||||
id: moduleId,
|
||||
stack: '',
|
||||
...err
|
||||
}
|
||||
throw createError({ data: errorData })
|
||||
})
|
||||
return module
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user