The watcher does not recognize file changes when the watched directory (or its parent) is deleted once
EhabY opened this issue · comments
This is the exact same issue as in #1042 except it happens when deleting the watched folder exactly and not a sub-directory.
Versions:
- Chokidar version: 3.5.3
- Node version: 16.17.0
- OS version: Windows 10
To Reproduce:
- Watch a folder (
test
)
const watcher = chokidar.watch("test");
watcher.on("all", (a, b) => console.log(a, b));
- Delete
test
folder - Create
test
folder again - Add a file inside of it (
file.txt
) - Modify
file.txt
Output
addDir test
unlinkDir test
Expected Output
addDir test
unlinkDir test
addDir test
add file.txt
change file.txt
The issue also happens if you delete any of the watched directories parents...
Additional context
Another issue happens when watching a single file: if you delete the file and then add it, events "change" and "add" are both triggered when it should only be "add".