Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

findAll errors when fail to read a directory #51

Closed
bluwy opened this issue Apr 4, 2022 · 0 comments · Fixed by #52
Closed

findAll errors when fail to read a directory #51

bluwy opened this issue Apr 4, 2022 · 0 comments · Fixed by #52

Comments

@bluwy
Copy link
Sponsor Contributor

bluwy commented Apr 4, 2022

Description

The findAll function doesn't handle errors when fail to read a directory.

const dirents = await fs.readdir(dir, { withFileTypes: true });

Reproduction

Found this from vitejs/vite#5765

npm init vite
mkdir foo
chmod 0 foo
npm run dev

Vite initializes tsconfck in configResolved and calls findAll here:

https://github.com/vitejs/vite/blob/cf59005a79dd7227f3ad63280761060ba224ce09/packages/vite/src/node/plugins/esbuild.ts#L296

Additional Information

  System:
    OS: macOS 12.3.1
    CPU: (8) arm64 Apple M1 Pro
    Memory: 498.75 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.13.0 - ~/.nvm/versions/node/v16.13.0/bin/node
    Yarn: 1.22.15 - ~/.nvm/versions/node/v16.13.0/bin/yarn
    npm: 8.5.5 - ~/.nvm/versions/node/v16.13.0/bin/npm
    Watchman: 2022.03.21.00 - /opt/homebrew/bin/watchman
  Browsers:
    Chrome: 99.0.4844.84
    Firefox: 98.0.2
    Safari: 15.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant