You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When chokidar first watches a directory, it very helpfully emits "add" and "addDir" events for each file and folder in that directory.
However, if you unwatch that directory and then re-watch it, chokidar does not emit the expected "add" and "addDir" events for the files and folders in that directory.
Versions (please complete the following information):
I ran into the same problem when I tried to write a file browser. The re-watch of the directory does not trigger the addition events that I rely on when adding items to the list.
Linux: arch
chokidar: @3.5.3
node: v17.3.0
PS duplicates of the folder that was unwatched are also added
I am also seeing this issue. My work around at the moment is recreating the entire file system watcher in order to properly trigger the initial watch event. I have a similar UI to @gavr123456789 where the user is able to remove/add directories to watch. If they remove an existing directory and then re-add it, it will not trigger the initial file add events.
Describe the bug
When chokidar first watches a directory, it very helpfully emits "add" and "addDir" events for each file and folder in that directory.
However, if you unwatch that directory and then re-watch it, chokidar does not emit the expected "add" and "addDir" events for the files and folders in that directory.
Versions (please complete the following information):
To Reproduce:
index.js:
Simulated console output:
Expected behavior
I expected that, upon re-watching the directory, chokidar would emit an "add" or an "addDir" event for each file/folder in the directory.
Instead, chokidar only emitted a single "addDir" event corresponding to the directory being rewatched.
The text was updated successfully, but these errors were encountered: