Describe the bug
When watching many files on macos. spawning a child process causes EBADF errors consistently. (likely due to reaching maximum file descriptors?)
Versions (please complete the following information):
- Chokidar version: v4
- Node version: 18, 20
- OS version: MacOS 15.1
To Reproduce:
https://github.com/bluwy/chokidar-lots-of-files-repro
Steps:
node gen.js (generate files in src/ to watch)
node test.js (watches files and tries to run the ls bash command)
Expected behavior
EBADF errors should not appear when spawning a child process after watching tons of files.
Additional context
With chokidar v4 removing fsevents and using fs.watch, this issue is blocking Vite and Nuxt from upgrading to v4 as there's no easy workaround to the problem (other than usePolling).
Users have also tried adjusting ulimit to extend the maximum file descriptors, but it didn't fix the issue.
Describe the bug
When watching many files on macos. spawning a child process causes EBADF errors consistently. (likely due to reaching maximum file descriptors?)
Versions (please complete the following information):
To Reproduce:
https://github.com/bluwy/chokidar-lots-of-files-repro
Steps:
node gen.js(generate files in src/ to watch)node test.js(watches files and tries to run thelsbash command)Expected behavior
EBADF errors should not appear when spawning a child process after watching tons of files.
Additional context
With chokidar v4 removing
fseventsand usingfs.watch, this issue is blocking Vite and Nuxt from upgrading to v4 as there's no easy workaround to the problem (other thanusePolling).unstoragev1.13.0 that uses chokidar v4)Users have also tried adjusting
ulimitto extend the maximum file descriptors, but it didn't fix the issue.