-
-
Notifications
You must be signed in to change notification settings - Fork 607
Open
Description
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 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 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).
- 6.0.0-beta.7 regression, browser does not open with "spawn EBADF" error vitejs/vite#18527
- EBADF error with Nuxt 3 and Vite on macOS, requiring esbuild version override nuxt/nuxt#29744 (has Nuxt-specific repro, which I believe relied on
unstoragev1.13.0 that uses chokidar v4) - fix: revert chokidar to v3 unjs/unstorage#502
Users have also tried adjusting ulimit to extend the maximum file descriptors, but it didn't fix the issue.
felixranesberger, sai-cb, DemonStore, usrrname, astoilkov and 4 more
Metadata
Metadata
Assignees
Labels
No labels