Watching multiple non-existing files in the same directory results in all files other than the first one being ignored
vilicvane opened this issue · comments
Versions (please complete the following information):
- Chokidar version 3.5.3
To Reproduce:
const FS = require("fs");
const Chokidar = require("chokidar");
const watcher = Chokidar.watch(["file-1", "file-2"]);
watcher.on("add", (path) => console.log(path));
// BTW, on("ready") doesn't work either.
setTimeout(() => {
FS.writeFileSync("file-2", ""); // file-1 would work.
}, 1000);
Expected behavior
All previously non-existing files should receive "add" event on creation.
Additional context
I traced down to the NodeFsHandler#_handleRead()
method and the way it throttles is the cause:
chokidar/lib/nodefs-handler.js
Lines 456 to 463 in 0f163b8
Has there been a workaround for this yet?