jeffijoe / typesync

Install missing TypeScript typings for dependencies in your package.json.
MIT License
1.51k stars 21 forks source link

Crash instead of handled not found error? #110

Closed sedrik closed 7 months ago

sedrik commented 7 months ago

Hi

When trying this project out I get a crash instead of handling of Not found errors. It is interesting that it is reporting ETIMEDOUT when the curl command returns directly. It doesn't feel like a timeout issue.

❯ typesync
»  TypeSync v0.11.1
⠇  Syncing type definitions in package.json.../home/sedrik/.local/share/nvm/v20.11.0/lib/node_modules/typesync/node_modules/minipass-fetch/lib/index.js:130
      reject(new FetchError(`request to ${request.url} failed, reason: ${
             ^

FetchError: request to https://registry.npmjs.org/%40types%2Fcommitlint__config-conventional failed, reason:
    at ClientRequest.<anonymous> (/home/sedrik/.local/share/nvm/v20.11.0/lib/node_modules/typesync/node_modules/minipass-fetch/lib/index.js:130:14)
    at ClientRequest.emit (node:events:518:28)
    at TLSSocket.socketErrorListener (node:_http_client:495:9)
    at TLSSocket.emit (node:events:530:35)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  code: 'ETIMEDOUT',
  errno: 'ETIMEDOUT',
  type: 'system'
}

Node.js v20.11.0
❯ curl https://registry.npmjs.org/%40types%2Fcommitlint__config-conventional
{"error":"Not found"}⏎ 
sedrik commented 7 months ago

When I tried again this morning it worked.