ViewBlock / binance-api-node

:chart: A complete and heavily tested wrapper with typings for the Binance API.
654 stars 495 forks source link

fix about node:fetch? #637

Closed hp8wvvvgnj6asjm7 closed 1 year ago

hp8wvvvgnj6asjm7 commented 1 year ago

https://github.com/nodejs/undici/issues/2170

hp8wvvvgnj6asjm7 commented 1 year ago

Any idea how to fix this?

Welcome to Node.js v20.2.0.
Type ".help" for more information.
> const res = await fetch('https://fapi.binance.com/fapi/v1/exchangeInfo', { method: 'GET' })
Uncaught TypeError: fetch failed
    at Object.fetch (node:internal/deps/undici/undici:11522:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async REPL1:1:37 {
  cause: Error [ERR_SOCKET_CONNECTION_TIMEOUT]: Socket connection timeout
      at new NodeError (node:internal/errors:399:5)
      at internalConnectMultiple (node:net:1099:20)
      at Timeout.internalConnectMultipleTimeout (node:net:1638:3)
      at listOnTimeout (node:internal/timers:575:11)
      at process.processTimers (node:internal/timers:514:7) {
    code: 'ERR_SOCKET_CONNECTION_TIMEOUT'
  }
}