Comments (2)
We experience a very similar problem, but with folder deletion. We use chokidar
like this:
chokidar.watch([
'src/foo/**/file.json',
'src/bar/**/file.json'
], {
useFsEvents: false, // <-- THIS SOLVES THE PROBLEM
ignoreInitial: true,
}).on('all', (eventName, path) => console.log({eventName, path}))
When we delete foo
or bar
folders, neither unlink
nor unlinkDir
are emitted. The reason for that seems to be this line:
chokidar/lib/fsevents-handler.js
Line 316 in 7c50e25
When a file patter contains a glob, it gets returned, so update is not reported.
The solution for us is to set useFsEvents: false
. It also seems to be used widely by other various libraries.
from chokidar.
I also reproduced this problem with @Janpot 's example but a little bit differently, I could get add
event when moving a dir, but no unlink
event.
from chokidar.
Related Issues (20)
- [v2: Vulnerability] Chokidar v2 is using glob-patern v3 which has a vulnerability HOT 5
- change event triggers even if file didnt change. HOT 2
- change event doesn't work after unlink HOT 2
- Node fs native recursive on Linux HOT 1
- Consider deduping entries passed to watch()
- Not Detecting New Files on External Drive in macOS HOT 3
- Change event is not emitted on Windows when continuously appending to an initially existing file HOT 2
- Incompatibility of types with recent changes in `@types/node` HOT 8
- consider switching to brace-expansion HOT 4
- Will there be a new release? HOT 1
- Looking for new contributors and maintainers HOT 10
- Failing unit tests on clean master HOT 5
- synchronous issues when using database operations when 'add' function is triggered
- Rename folder with files sends first unlinkdir and then unlink for all files
- Windows move command failed to move multi-level directories during chokidar monitoring
- Help!!! Chokidar watch not working
- Vulnerable Dependency - braces HOT 4
- `optionalDependencies` are not installed on macOS runners
- Packages that uses Chokidar fails to install on npm > 10.3.0 HOT 1
- CVE-2024-4068 - update braces to ^3.0.3 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chokidar.