Closed charlieforward9 closed 1 month ago
Hi, @charlieforward9. I cannot help much without the repo and reproduction steps, sorry.
One common root cause for a generic "Network error" was related to bugs in Undici. I recommend upgrading your Node.js to the latest version. If you can't, update to the latest version within your range (e.g. ^18.0.0
). That will give you all the bugfixes to Undici that may be breaking your Node.js's fetch
.
If you find more details, please share. Thanks.
Prerequisites
Environment check
msw
versionNode.js version
v18.18.2
Reproduction repository
TODO
Reproduction steps
TODO
Current behavior
We just moved all of our api calls into graphql-codegen'ed RTK query hooks. During the process, we updated our Amplify and MSW dependencies. We are using Vitest and try to stay on the latest stable version, currently 1.5.3. Looking to bump soon.
Now when I run my tests, the first few API calls will go through (auth, first query), but after the first query, subsequent queries will not be matched.
I have the server event callbacks showing that once the issue starts, I do not see any "request:start" event, and i ultimately get this error.
Expected behavior
Work as it did prior to the dependency and structure changes. No network errors for handled GraphQL operations.
I would love to provide more details if I could figure out where to start. With so many layers packed on top of one another, it will be quite a bit of work to attempt a reproduction, but I will do this if necessary, I just need some explanation on what COULD be happening to understand where to start reproducing.
CC: @sainaruufl