-
Notifications
You must be signed in to change notification settings - Fork 311
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
Comments
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); |
This has already been resolved under #597. |
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 ? |
**Problem** At some point, the sdk-core/subgraph test cases started to fail with "socket hang up" error when querying subgraph. After some research, it was discovered that it is due to the usage of an older version of the "cross-fetch" polyfill which didn't support node 20+, see [here](graffle-js/graffle#628) and [here](graffle-js/graffle#597). **Solution** The newer cross-fetch project solved this. The solution is to fix the "resolution" of the cross-fetch in this project to the latest, for now. Additionally, this PR also: a) include some minor refactoring around the test setup process, b) test against both node 18 and 20 for SDK core, and test against node 20 for subgraph.
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.
The text was updated successfully, but these errors were encountered: