From cfaca9c5c72ceec968ab13851e991fb7161823a4 Mon Sep 17 00:00:00 2001 From: pooya parsa Date: Fri, 16 Sep 2022 19:43:35 +0200 Subject: [PATCH] fix(vite): normalize vite-node error data from server (#7589) --- packages/vite/src/vite-node.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/vite/src/vite-node.ts b/packages/vite/src/vite-node.ts index 109d1349ce..97bee4618e 100644 --- a/packages/vite/src/vite-node.ts +++ b/packages/vite/src/vite-node.ts @@ -113,7 +113,13 @@ function createViteNodeMiddleware (ctx: ViteBuildContext, invalidates: Set { - throw createError({ data: err }) + const errorData = { + code: 'VITE_ERROR', + id: moduleId, + stack: '', + ...err + } + throw createError({ data: errorData }) }) return module }