Skip to content

net autoSelectFamily functions not available in 18.8.0 #50017

@lukekarrys

Description

@lukekarrys

Version

v18.8.0

Platform

Darwin pieholden-m1.local 22.6.0 Darwin Kernel Version 22.6.0: Fri Sep 15 13:41:30 PDT 2023; root:xnu-8796.141.3.700.8~1/RELEASE_ARM64_T8103 arm64 arm Darwin

Subsystem

net

What steps will reproduce the bug?

node -e 'console.log(process.version, typeof net.getDefaultAutoSelectFamily)'

Running the previous code in 18.8.0 shows that net.getDefaultAutoSelectFamily is undefined. Looking at the recent changelog, I believe this function (and the other related autoSelectFamily getters/setters) should be included in this release.

Here's the output from running the above code using both 18.8.0 and 20.8.0 on my machine:

❯ fnm use 18.8.0
Using Node v18.8.0
❯ node -e 'console.log(process.version, typeof net.getDefaultAutoSelectFamily)'
v18.8.0 undefined
❯ fnm use 20.8.0
Using Node v20.8.0
❯ node -e 'console.log(process.version, typeof net.getDefaultAutoSelectFamily)'
v20.8.0 function

How often does it reproduce? Is there a required condition?

This reproduces every time for me.

What is the expected behavior? Why is that the expected behavior?

net.getDefaultAutoSelectFamily and net.setDefaultAutoSelectFamily should both be functions. This is expected because #45777 is indicated as having been backported to v18.

What do you see instead?

net.getDefaultAutoSelectFamily and net.setDefaultAutoSelectFamily are undefined.

Additional information

The functions are listed in the docs (https://nodejs.org/docs/latest-v18.x/api/net.html#netgetdefaultautoselectfamily) but with Added in: v19.4.0. This might be related.

Metadata

Metadata

Assignees

No one assigned

    Labels

    netIssues and PRs related to the net subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions