-
Notifications
You must be signed in to change notification settings - Fork 30.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dns.lookup options..family throw errors when using 'IPv4' #54961
Comments
It is expected to removed since the start of Reference #41431 |
The `'IPv4'` and `'IPv6'` values are no longer supported. Fixes: nodejs#54961
The `'IPv4'` and `'IPv6'` values are no longer supported. Fixes: nodejs#54961
The documentation is ok. The value |
@lpinca Indeed, upon checking https://nodejs.org/api/dns.html#dnspromiseslookuphostname-options it is indeed unsupported.
|
@tomek3e that should be fixed in the DefinitelyTyped repository. |
Version
v22.4.0
Platform
Subsystem
dns
What steps will reproduce the bug?
import dns from 'node:dns/promises';
async function dnsLookup(){
await dns.lookup("localhost", {family: 'IPv4' })
}
dnsLookup()
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
Function not to throw.
What do you see instead?
Throws
TypeError: The property 'options.family' must be one of: 0, 4, 6. Received 'IPv4'
Additional information
Same happens on v20.14.0, v18.18.0.
According to the documentation IPv4 and IPv6 should be accepted https://nodejs.org/docs/latest-v22.x/api/dns.html#dnslookuphostname-options-callback
The text was updated successfully, but these errors were encountered: