Skip to content
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

Node.js 20 compatibility #5929

Closed
Pharb opened this issue Sep 29, 2023 · 15 comments
Closed

Node.js 20 compatibility #5929

Pharb opened this issue Sep 29, 2023 · 15 comments

Comments

@Pharb
Copy link

Pharb commented Sep 29, 2023

Describe the bug

Axios tests fail on Node.js 20 (will be next LTS version starting 2023-10-24).

There probably are breaking changes affecting HTTP clients, e.g.:

To Reproduce

Run tests with Node.js 20: https://github.com/Pharb/axios/actions/runs/6348646385/job/17245665305

Expected behavior

Axios works and is tested for Node.js 20

Axios Version

v1.5.1

Node.js Version

v20.7.0, v20.8.0

OS

Ubuntu 22.04.3, macOS 13.6

Additional context/Screenshots

@woodmark-dev
Copy link

Hello there,
I want to work on this issue. Thank you.

@MerzDaniel
Copy link

This is a critical bug for us. Has there already been some progress?

@Pharb
Copy link
Author

Pharb commented Oct 18, 2023

@DigitalBrainJS Could you please provide a statement on the plan how to resolve outstanding issues for Node.js 20?

Currently 4 unit tests fail with Node 20.8.0 and Axios is affected by nodejs/node#47130.

@adijesori
Copy link

@Pharb Did you find a workaround for this? We are suffering from the same

@Pharb
Copy link
Author

Pharb commented Dec 14, 2023

I see that axios v1.6.0 is now tested for Node.js 20 - so this issue can be closed:

There are still problems with axios v1.6.2 and Node.js 20 resulting in ECONNRESET on localhost HTTP requests - my current workaround is this:

 axios.create({
    httpAgent: new Agent({ keepAlive: false })
  });

The Node.js issue is still open: nodejs/node#47130

@Pharb Pharb closed this as completed Dec 14, 2023
@adijesori
Copy link

I see that axios v1.6.0 is now tested for Node.js 20 - so this issue can be closed:

There are still problems with axios v1.6.2 and Node.js 20 resulting in ECONNRESET on localhost HTTP requests - my current workaround is this:

 axios.create({
    httpAgent: new Agent({ keepAlive: false })
  });

The Node.js issue is still open: nodejs/node#47130

Thanks @Pharb! Will try that

Does this node 20 issue happens to you only on localhost HTTP requests? For us it is happening also with remote calls

@Pharb
Copy link
Author

Pharb commented Dec 14, 2023

Does this node 20 issue happens to you only on localhost HTTP requests? For us it is happening also with remote calls

I did not have problems with HTTPS remote calls. For me it was only a problem with HTTP requests to localhost.

@akwodkiewicz
Copy link

For us it's also happening with remote calls, but I guess the URL does not matter here.

The most important thing is that while the workaround works1, it cannot be easily applied to projects, because axios is very often 2 a dependency of some 3rd party SDKs. Sometimes the packages allow you to pass some axios config to initialize them, but it is not common. And I'm not sure if that's even possible to override the axios config globally for all deps.

So, unfortunately, I think we still need to wait for the resolution of the issue on Node's side (nodejs/node#47130)

Footnotes

  1. I did not test it myself, but I believe you 😄

  2. I'd even say it's a de-facto standard HTTP library

@jfaissolle
Copy link

It seems I am encountering this problem with Axios 1.6+ and Node 20.10 when using Promise.all() to simultaneously run several requests on the same server.

@SebasAnasco1517
Copy link

SebasAnasco1517 commented Feb 29, 2024

Hi, do you know if this is going to be corrected in node? I have this issue with Axios 1.6.7 and node 20.

@born2net
Copy link

born2net commented Mar 4, 2024

same here, node 20 and does not send texts

@born2net
Copy link

born2net commented Mar 4, 2024

Hi, do you know if this is going to be corrected in node? I have this issue with Axios 1.6.7 and node 20.

same issue here :/

@softy2k
Copy link

softy2k commented Apr 8, 2024

Same issue with Node 20.12.1 and Axios 1.6.8
Is Ok whit same config but with Node 18.20.1

@joelin-vyond
Copy link

H there,
Since Node c22 is just released, it would be great to know whether the issue has been fixed in Node 22, or we still have to use node v16 or the other http client undici?

Thanks,
Joe Lin

@elovin
Copy link

elovin commented May 7, 2024

We do not have this issue at all and we have been using node 20 just after it entered LTS.
Although we use RXJS to wrap promises and handle retries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests