Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The watcher does not recognize file changes when the watched directory (or its parent) is deleted once #1278

Open
EhabY opened this issue Apr 1, 2023 · 0 comments

Comments

@EhabY
Copy link

EhabY commented Apr 1, 2023

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:

  1. Watch a folder (test)
const watcher = chokidar.watch("test");
watcher.on("all", (a, b) => console.log(a, b));
  1. Delete test folder
  2. Create test folder again
  3. Add a file inside of it (file.txt)
  4. 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".

@EhabY EhabY changed the title The watcher does not recognize file changes when the watched directory is deleted once The watcher does not recognize file changes when the watched directory (or its parent) is deleted once Apr 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant