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
{{ message }}
Repository navigation
Bug: walk()/list() fails with ENOENT if directory is deletedΒ #154
Running eslint in parallel to other tools that create/delete empty folders made eslint to crash while listing directory contents.
What did you expect to happen?
Deleting an empty directory while linter is running should not crash it.
What actually happened?
Error: ENOENT: no such file or directory, scandir 'D:\js-clients\tsconfig.src.json.lock'
at async Object.readdir (node:internal/fs/promises:958:18)
at async NodeHfsImpl.list (file:///D:/js-clients/node_modules/@humanfs/node/src/node-hfs.js:304:19)
at async NodeHfs.<anonymous> (file:///D:/js-clients/node_modules/@humanfs/core/src/hfs.js:560:21)
at async NodeHfs.<anonymous> (file:///D:/js-clients/node_modules/@humanfs/core/src/hfs.js:604:6)
at async NodeHfs.walk (file:///D:/js-clients/node_modules/@humanfs/core/src/hfs.js:614:3)
at async globSearch (D:\js-clients\node_modules\eslint\lib\eslint\eslint-helpers.js:331:20)
at async Promise.allSettled (index 0)
at async globMultiSearch (D:\js-clients\node_modules\eslint\lib\eslint\eslint-helpers.js:422:18)
at async findFiles (D:\js-clients\node_modules\eslint\lib\eslint\eslint-helpers.js:593:24)
at async ESLint.lintFiles (D:\js-clients\node_modules\eslint\lib\eslint\eslint.js:734:21)
Link to Minimal Reproducible Example
Participation
I am willing to submit a pull request for this issue.
changed the title [-]Bug: list() fails with ENOENT if directory is deleted[/-][+]Bug: walk()/list() fails with ENOENT if directory is deleted[/+]on Aug 25, 2025
the example i posted in the previous comment - it follows the same code structure (async generator) as the walk+list code in this package, and shows that the mitigation implemented in #135 isn't actually working. The test in there does not match the implementation - as the test doesn't implement list as an async generator.
Right, but that's reproducing your theory of how the bug is working, that's not using the actual code to reproduce the error. That's what I'm asking for.
Activity
[-]Bug: list() fails with ENOENT if directory is deleted[/-][+]Bug: walk()/list() fails with ENOENT if directory is deleted[/+]Knagis commentedon Aug 25, 2025
Issue seems to be that the
readdircall is done on the first await of the iterator, not when the function is called, so the existing try/catch has no effect: https://github.com/humanwhocodes/humanfs/blob/main/packages/core/src/hfs.js#L552for example, this shows "error on loop":
nzakas commentedon Aug 25, 2025
Thanks for the report. Can you put together a reproduction case I can look at?
Knagis commentedon Aug 25, 2025
the example i posted in the previous comment - it follows the same code structure (async generator) as the walk+list code in this package, and shows that the mitigation implemented in #135 isn't actually working. The test in there does not match the implementation - as the test doesn't implement
listas an async generator.nzakas commentedon Aug 28, 2025
Right, but that's reproducing your theory of how the bug is working, that's not using the actual code to reproduce the error. That's what I'm asking for.
ken0891992-hub commentedon Jul 22, 2026
Duplicate of #164
fix: Ensure walk() skips directories deleted before they are listed