-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
Fetch doesn't work in 19.3.0 #46049
Comments
This was fixed in nodejs/undici#1787 and undici was updated in #45812, it doesn't appear as though it made it into v19.3.0 though. |
v19.4.0 have #45812 , so should be fixed by now in latest version (though I haven't tested it personally) |
Note this bug made it into v18.13.0 as well. Related comment |
I'm still getting this bug in v18.14.2. |
please post a new issue in https://github.com/nodejs/undici/ with a small repro |
Downgrading to an older Node version (applicable to my case) fixes the issue. |
this bug made it to node v18.16.0 |
@fawazahmed0 is there a fix for node 18.x? |
I'd recommend using the fetch that undici exports, rather than the global one. Then you won't have to worry about old versions of node not receiving fixes or new features. |
@KhafraDev so you are basically saying that using the global fetch in node should be deprecated and the fetch itself should be removed? |
No, not at all. I'm saying that if there's an issue, for example, in v19.0.0 then you either have to update node to a version that ships undici's fix(es), or use undici itself. |
The issue exists in v18.x versions as well (as other commenters pointed out) Otherwise, if that's not the case, this feature should not be added to the Node itself. |
Fetch is currently marked as experimental which means that it is "not recommended in production environments."1 However, I don't see anything that would prevent someone from backporting one of the undici updates to v18.x, it's just that no one has. Of course then you'll still have issues in older node 18 versions. Undici's fetch works from v16.8.0 to v20 so you don't need to deal with backports, buggy versions, and the like. Footnotes |
I just migrated node from v18.x to v21.7.0 hoping to solve this issue but I still get this error in production.
My API call is entirely wrapped inside a try-catch. Should I stop using fetch?
|
Version
19.3.0
Platform
Microsoft Windows NT 10.0.22000.0 x64
Subsystem
No response
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
No response
What is the expected behavior?
No response
What do you see instead?
Additional information
The same code works fine in
v18.12.1
If you are interested, here is my complete code:
The text was updated successfully, but these errors were encountered: