From 20bc2a1551ce74f5ebfe2012e54d4d362da074a3 Mon Sep 17 00:00:00 2001 From: vnc5 Date: Wed, 27 Sep 2023 12:29:53 +0200 Subject: [PATCH] watch: fix null `fileName` on windows systems --- lib/internal/watch_mode/files_watcher.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/watch_mode/files_watcher.js b/lib/internal/watch_mode/files_watcher.js index 895c6ec138d131..51b09c840b65f4 100644 --- a/lib/internal/watch_mode/files_watcher.js +++ b/lib/internal/watch_mode/files_watcher.js @@ -98,7 +98,7 @@ class FilesWatcher extends EventEmitter { } const watcher = watch(path, { recursive, signal: this.#signal }); watcher.on('change', (eventType, fileName) => this - .#onChange(recursive ? resolve(path, fileName) : path)); + .#onChange(recursive ? resolve(path, fileName ?? '') : path)); this.#watchers.set(path, { handle: watcher, recursive }); if (recursive) { this.#removeWatchedChildren(path);