From d8675174ebc80fcc16d70fc5f4e323dd3f5544c7 Mon Sep 17 00:00:00 2001 From: Mohamed Boudra Date: Mon, 26 Oct 2026 19:41:33 +0100 Subject: [PATCH] fix(server): retire the compiler worker after build errors A failed parallel target can leave the other target compiling. Await worker termination before the next queued request instead of reusing an isolate with unfinished build work. --- packages/server/src/server/plugins/compiler.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/server/src/server/plugins/compiler.ts b/packages/server/src/server/plugins/compiler.ts index 33d2429d86..829acd1862 100644 --- a/packages/server/src/server/plugins/compiler.ts +++ b/packages/server/src/server/plugins/compiler.ts @@ -113,6 +113,9 @@ class PluginCompiler { const error = reply.issues ? new ZodError(reply.issues) : reply.error; if (reply.errors) Object.assign(error, { errors: reply.errors }); if (reply.warnings) Object.assign(error, { warnings: reply.warnings }); + // Promise.all can reject while the other target is still compiling. + // Retire the isolate before another request can enter it. + this.stopWorker(worker); reject(error); } };