From 92c2a72f62369f55a2a60c991f81a3788861a4a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=90=91=E5=A4=9C?= <46275354+fu050409@users.noreply.github.com> Date: Fri, 10 Jan 2025 11:20:55 +0800 Subject: [PATCH] fix: fix panic on irrelevant file deletion (#2055) --- packages/core/src/server/index.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/core/src/server/index.ts b/packages/core/src/server/index.ts index ba7beecd4..b24e36bb7 100644 --- a/packages/core/src/server/index.ts +++ b/packages/core/src/server/index.ts @@ -255,6 +255,9 @@ export class Server extends httpServer { }); this.watcher.on('unlink', async (file: string) => { + // Fix #2035, skip if the file is irrelevant + if (!this.compiler.hasModule(file)) return; + const parentFiles = this.compiler.getParentFiles(file); const normalizeParentFiles = parentFiles.map((file) => normalizePath(file)