We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9db4bf4 commit 660659fCopy full SHA for 660659f
lib/internal/watch_mode/files_watcher.js
@@ -97,8 +97,11 @@ class FilesWatcher extends EventEmitter {
97
return;
98
}
99
const watcher = watch(path, { recursive, signal: this.#signal });
100
- watcher.on('change', (eventType, fileName) => this
101
- .#onChange(recursive ? resolve(path, fileName ?? '') : path));
+ watcher.on('change', (eventType, fileName) => {
+ // `fileName` can be `null` if it cannot be determined. See
102
+ // https://github.com/nodejs/node/pull/49891#issuecomment-1744673430.
103
+ this.#onChange(recursive ? resolve(path, fileName ?? '') : path);
104
+ });
105
this.#watchers.set(path, { handle: watcher, recursive });
106
if (recursive) {
107
this.#removeWatchedChildren(path);
0 commit comments