diff --git a/integrations/filesystem-watcher/watcher.mjs b/integrations/filesystem-watcher/watcher.mjs index d68b2b8d16..c7c68a084f 100644 --- a/integrations/filesystem-watcher/watcher.mjs +++ b/integrations/filesystem-watcher/watcher.mjs @@ -248,6 +248,8 @@ export class FilesystemWatcher { const failures = []; for (const root of this.roots) { try { + const st = statSync(root); + if (!st.isDirectory()) throw new Error("not a directory"); const handle = watch( root, { recursive: true, persistent: true },