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)