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

ECONNRESET on node19+ #628

Closed
zonofthor opened this issue Dec 4, 2023 · 3 comments
Closed

ECONNRESET on node19+ #628

zonofthor opened this issue Dec 4, 2023 · 3 comments

Comments

@zonofthor
Copy link

Screenshot

n/a

Description

node-fetch causes a socket-hang-up bug on node19 and higher and is described extensively here node-fetch/node-fetch#1735.

I ran into this exactly on our node server that creates seed data on localhost using batched API calls using graphql-request.

I don't know the inner workings of graphql-request but I would have thought this requires an upgrade of currently used node-fetch package since bug has been fixed there?

Reproduction Steps/Repo Link

There is nothing out of the ordinary here, just std. use of graphql-request which has worked perfectly for 3 years until my node version was upgraded.

@ChrisLahaye
Copy link

We experienced the same issue. By default, this package uses cross-fetch, unless another fetch function is specified. You can use your own GraphQLClient instance with your desired fetch, e.g. node's native fetch, which does not have this issue.

const client = new GraphQLClient(url, { fetch });

await client.request(document);

@jonkoops
Copy link
Collaborator

This has already been resolved under #597.

@code-vagabond
Copy link

code-vagabond commented Apr 22, 2024

We experienced the same issue. By default, this package uses cross-fetch, unless another fetch function is specified. You can use your own GraphQLClient instance with your desired fetch, e.g. node's native fetch, which does not have this issue.

const client = new GraphQLClient(url, { fetch });

await client.request(document);

According to #597 this issue should be fixed since cross-fetch has been removed, but somehow I still encounter it in version 6.1.0 and could only fix by specifying fetch manually as above, did I miss something ?

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

No branches or pull requests

5 participants