From 4d41bfd3664eee2f4d84d8c7ee631185bd36b351 Mon Sep 17 00:00:00 2001 From: Haileyesus Date: Thu, 12 Feb 2026 20:40:56 +0300 Subject: [PATCH] fix(watcher): ensure provider folders exist before creating watchers to maintain active watching --- server/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/index.js b/server/index.js index bc9667c..bac8e0b 100755 --- a/server/index.js +++ b/server/index.js @@ -163,6 +163,10 @@ async function setupProjectsWatcher() { for (const { provider, rootPath } of PROVIDER_WATCH_PATHS) { try { + // chokidar v4 emits ENOENT via the "error" event for missing roots and will not auto-recover. + // Ensure provider folders exist before creating the watcher so watching stays active. + await fsPromises.mkdir(rootPath, { recursive: true }); + // Initialize chokidar watcher with optimized settings const watcher = chokidar.watch(rootPath, { ignored: WATCHER_IGNORED_PATTERNS,