From d1214c9aae633b84ac3303815e5eb9e3d48aa627 Mon Sep 17 00:00:00 2001 From: pooya parsa Date: Wed, 20 Oct 2021 21:28:01 +0200 Subject: [PATCH] fix(nitro): terminate active worker before replacing (#1302) --- packages/nitro/src/server/dev.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/nitro/src/server/dev.ts b/packages/nitro/src/server/dev.ts index 0c7cfbd282..7edb83a8c4 100644 --- a/packages/nitro/src/server/dev.ts +++ b/packages/nitro/src/server/dev.ts @@ -44,6 +44,9 @@ export function createDevServer (nitroContext: NitroContext) { worker.on('message', (event) => { if (event && event.port) { workerAddress = 'http://localhost:' + event.port + if (activeWorker) { + activeWorker.terminate() + } activeWorker = worker pendingWorker = null resolve(workerAddress)