Skip to content

Commit 301604f

Browse files
committed
fix(vite): trap unhandled errors in worker
1 parent 2fb634a commit 301604f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/runtime/internal/vite/node-runner.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,10 @@ parentPort.on("message", (payload) => {
151151
}
152152
});
153153

154+
// Trap unhandled errors to avoid worker crash
155+
process.on("unhandledRejection", (error) => console.error(error));
156+
process.on("uncaughtException", (error) => console.error(error));
157+
154158
// ----- Server -----
155159

156160
async function reload() {

0 commit comments

Comments
 (0)