Closed MikeMcC399 closed 1 year ago
Due to GitHub setting Node.js default to 18 recently, this issue and related issues are becoming more visible.
Port the "Happy Eyeballs" implementation from https://github.com/metcoder95/wait-on/pull/20 into this repository.
Set autoSelectFamily
to true (default is false)
See https://nodejs.org/dist/latest-v18.x/docs/api/net.html#socketconnect
autoSelectFamily
Also worth it to mention that autoSelectFamily
is not backported (and most likely it won't be) to Node.js versions < 18, meaning that fully moving into autoSelectFamily
will result in a major bump.
If looking to preserve support for older versions, a combination of both approaches can be done.
@jeffbski
This seems quite the showstopper for wait-on
under Node.js 18 and later. Are you able to comment and share your plans?
The 127.0.0.1 workaround does not work for me.
Regarding this, it's possible to change the default DNS resolution order with dns.setDefaultResultOrder('ipv4first');
, but it's not helping either for me.
On Node 18, it's stuck indefinitely on any tcp:<host>:<port>
combination š¢
@sinedied
The 127.0.0.1 workaround does not work for me.
Are you using the react-app
or something else? If it is something else then you should open a new issue.
It depends on the server what the right workaround is. It could be using 127.0.0.1
instead of localhost
or it could be [::1]
instead of localhost
. Some other servers can be started in an alternate way, by specifying a host parameter 0.0.0.0
(for instance -h 0.0.0.0
, -host 0.0.0.0
, -HOST 0.0.0.0
according to the appropriate documentation) which makes them listen on both IPv4 and IPv6. That does not work for all development servers however.
I finally found a workaround, had to use a mix of localhost
and 127.0.0.1
depending on the host server. But yeah it's really not user friendly :/
::1
loopback address response.Ran into this same problem as well. Thankfully (I guess?) I know what port my app has to run on and have had no problems changing from wait-on http://localhost:300
to wait-on tcp:3000
.
I retested this issue and it is still reproducible on Node.js 18.16.0 which remains as the LTS version until Node.js 20.x takes over the LTS role on Oct 24, 2023 (see Node.js release schedule).
The issue is however not reproducible on Node.js 20.2.0. See job 9155121075 which succeeds.
Updating to Node.js 20.x may therefore be a workaround for some situations.
I will leave this issue open, probably until Node.js 20.x gets LTS status.
I started to have the same issue on my CRA app (react scripts 4) and NodeJS 18. After I switched from localhost:3000
to 127.0.0.1:3000
it started to work again
18
.16
, 20
or 21
.wait-on
which remains at version v7.0.1 from Dec 2022.20
or 21
)So, now closing this issue, as there is nothing more to do here.
Environment
ubuntu-22.04 on GitHub Node.js 18.14.1
wait-on 7.0.1
Problem description
wait-on fails waiting for http://localhost:3000 of react-app on GitHub in an
ubuntu-22.04
runner using the current default Node.js 18.14.1. The problem does not happen using Node.js 16.19.1.Node.js 18 is the default version on GitHub runners since Feb 18, 2023.
verbose logs show:
netstat shows the following listener:
Steps to reproduce
GitHub
View workflow log https://github.com/MikeMcC399/react-app-test/actions/workflows/test-react-app-wait-on.yml or
fork https://github.com/MikeMcC399/react-app-test and run .github/workflows/test-react-app-wait-on.yml
Workaround
wait for http://127.0.0.1:3000 instead of http://localhost:3000
Related issues