dominikg / tsconfck

A utility to find and parse tsconfig files without depending on typescript
Other
293 stars 14 forks source link

findAll errors when fail to read a directory #51

Closed bluwy closed 2 years ago

bluwy commented 2 years ago

Description

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

https://github.com/dominikg/tsconfck/blob/2b787ca14cd29b56c19b01f60854a282dd659571/src/find-all.ts#L25

Reproduction

Found this from https://github.com/vitejs/vite/issues/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