Is autoSelectFamily possible to counteract Node.js 18 dns.lookup changes?
#2235
-
|
Is it possible to use This is turning out to be a problem with some dev servers, for instance Angular or Vite, as GitHub has now migrated their runners to use Node.js 18 as default and the change in logic in Node.js has kicked in. Node.js 17.0.0 introduced the change in nodejs/node@1b2749ecbe "(SEMVER-MAJOR) dns: default to verbatim=true in dns.lookup()". (See History in dns.lookup(hostname[, options], callback).) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Got already has a solution for this. You can use the await got('http://localhost:3000', {
dnsLookupIpVersion: 4
});Alternatively, use 127.0.0.1 directly instead of localhost. The autoSelectFamily option could be added as a pass-through to Node.js, but given the existing workarounds, I don't think it's necessary. |
Beta Was this translation helpful? Give feedback.
Got already has a solution for this. You can use the
dnsLookupIpVersionoption to force IPv4:Alternatively, use 127.0.0.1 directly instead of localhost.
The autoSelectFamily option could be added as a pass-through to Node.js, but given the existing workarounds, I don't think it's necessary.