software by Stafford Williamsstafford williams
home blog devlog notes links talks apps about

2025-03-25 9:49pm

node, spacetraders-v2

Burnt a couple of nights chasing this one. Node was throwing ETIMEDOUT AggregateError when hitting https://api.spacetraders.io/v2 even though curl to the same address had no issue. Turns out node attempts resolve ipv6 first, and in the case of SpaceTraders API ipv6 can be resolved but the API doesn’t support it, however, the resolution time goes over 250ms from Australia to wherever it’s hosted, throwing ETIMEDOUT. The solution is to:

javascript
net.setDefaultAutoSelectFamilyAttemptTimeout(500)
  • If this was helpful, please share:

  • Reddit icon
  • Y Combinator icon
  • Twitter icon
  • LinkedIn icon
  • software by Stafford Williams
about
  • LinkedIn icon
  • Icon Letter Mail image/svg+xml Openclipart icon_letter_mail 2010-01-29T13:59:32 https://openclipart.org/detail/29117/icon_letter_mail-by-jean_victor_balin jean_victor_balin icon letter mail mailing unchecked
{{language}}