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); } };