From bb2a8caddc4b4aebb10bcc1fc2a20e3133e0897c Mon Sep 17 00:00:00 2001 From: Mustafa Senoglu Date: Fri, 26 Jun 2026 18:02:42 +0300 Subject: [PATCH] fix: enable Chokidar polling for Vite HMR in Docker on Windows Native fs events do not propagate from Windows hosts into Linux containers, causing Vite's HMR to stop detecting file changes. When the DOCKER environment variable is set, Chokidar now falls back to polling with a 300ms interval, which reliably detects changes across the Docker volume mount boundary. Fixes #2456 --- deployment/docker-compose-local.yaml | 1 + frontend/vite.config.ts | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/deployment/docker-compose-local.yaml b/deployment/docker-compose-local.yaml index b21637f1..89ee631f 100644 --- a/deployment/docker-compose-local.yaml +++ b/deployment/docker-compose-local.yaml @@ -7,6 +7,7 @@ services: - VITE_API_HOST=http://localhost:7091 - VITE_API_STREAMING=$VITE_API_STREAMING - VITE_EMBEDDINGS_NAME=$EMBEDDINGS_NAME + - DOCKER=true ports: - "5173:5173" diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index ae507f82..a46077e5 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -22,6 +22,12 @@ export default defineConfig(({ mode }) => { .map((h) => h.trim()) .filter(Boolean) : [], + // Use polling for file watching when running inside Docker. + // Native fs events do not propagate from Windows hosts into Linux + // containers, so Chokidar falls back to polling which works reliably. + watch: env.DOCKER + ? { usePolling: true, interval: 300 } + : undefined, }, test: { environment: 'happy-dom',