From cb762a5fede3f45a7276719b950a6fc7bbe9c1a5 Mon Sep 17 00:00:00 2001 From: Vladimir Sheremet Date: Fri, 4 Oct 2024 15:58:30 +0200 Subject: [PATCH] fix(vite): destroy the runner when runnable environment is closed --- .../src/node/server/environments/runnableEnvironment.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/vite/src/node/server/environments/runnableEnvironment.ts b/packages/vite/src/node/server/environments/runnableEnvironment.ts index c47298a22920f6..eaea7e826ca26f 100644 --- a/packages/vite/src/node/server/environments/runnableEnvironment.ts +++ b/packages/vite/src/node/server/environments/runnableEnvironment.ts @@ -57,6 +57,13 @@ class RunnableDevEnvironment extends DevEnvironment { this._runner = createServerModuleRunner(this) return this._runner } + + override async close(): Promise { + await super.close() + if (this._runner) { + this._runner.destroy() + } + } } export type { RunnableDevEnvironment }