You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A clear and concise description of what the bug is.
Versions (please complete the following information):
Chokidar version [e.g. 3.2.1 or commit hash] 3.6.0
Node version [e.g. 12.11.0, ensure you are using the latest node.js] 20.9.0
OS version: [e.g. Ubuntu 19.04 or MacOS 10.15 or Windows 10]
To Reproduce:
We have a number of these stack traces where an error occurs within the async function on this line:
Error: ENOSPC: System limit for number of file watchers reached, watch '/home/runner/Foodsource5/add_test_data.py'
File "node:internal/fs/watchers", line 247, col 19, in FSWatcher.<computed>
File "node:fs", line 2392, col 36, in Object.watch
File "../../../node_modules/.pnpm/[email protected]/node_modules/chokidar/lib/nodefs-handler.js", line 119, col 15, in createFsWatchInstance
return fs.watch(path, options, handleEvent);
File "../../../node_modules/.pnpm/[email protected]/node_modules/chokidar/lib/nodefs-handler.js", line 166, col 15, in setFsWatchListener
watcher = createFsWatchInstance(
File "../../../node_modules/.pnpm/[email protected]/node_modules/chokidar/lib/nodefs-handler.js", line 331, col 14, in NodeFsHandler._watchWithNodeFs
closer = setFsWatchListener(path, absolutePath, options, {
File "../../../node_modules/.pnpm/[email protected]/node_modules/chokidar/lib/nodefs-handler.js", line 395, col 23, in NodeFsHandler._handleFile
const closer = this._watchWithNodeFs(file, listener);
File "../../../node_modules/.pnpm/[email protected]/node_modules/chokidar/lib/nodefs-handler.js", line 637, col 21, in NodeFsHandler._addToNodeFs
closer = this._handleFile(wh.watchPath, stats, initialAdd);
File "../../../node_modules/.pnpm/[email protected]/node_modules/chokidar/index.js", line 451, col 21, in <anonymous>
const res = await this._nodeFsHandler._addToNodeFs(path, !_internal, 0, 0, _origAdd);
File "index 0", in Promise.all
It bubbles, but since add is sync, and there is no .catch on this line, its thrown to the global unhandled rejection handler. Would it be possible to update the API to allow callsites to handle this error more locally? Either make add async, add an error callback parameter, etc.?
I checked v4.0 and it appears the same code is still in place.
Thank you!
Expected behavior
A clear and concise description of what you expect to happen.
Additional context
Add any other context about the problem here.
Optionally nice to know what project you are working on.
The text was updated successfully, but these errors were encountered:
The current behavior of add is definitely problematic. I think making it async would be awesome. It would be a great replacement for the ready event, which is only emitted once even though I might want to watch multiple directories at various times throughout the lifecycle of the watcher.
Describe the bug
A clear and concise description of what the bug is.
Versions (please complete the following information):
To Reproduce:
We have a number of these stack traces where an error occurs within the async function on this line:
It bubbles, but since
add
is sync, and there is no.catch
on this line, its thrown to the global unhandled rejection handler. Would it be possible to update the API to allow callsites to handle this error more locally? Either makeadd
async, add an error callback parameter, etc.?I checked v4.0 and it appears the same code is still in place.
Thank you!
Expected behavior
A clear and concise description of what you expect to happen.
Additional context
Add any other context about the problem here.
Optionally nice to know what project you are working on.
The text was updated successfully, but these errors were encountered: