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

Recieving Network error after moving to codegen msw handlers, various dependency upgrades and the addition of RTK query. #2174

Open
4 tasks done
charlieforward9 opened this issue Jun 6, 2024 · 0 comments
Labels
bug Something isn't working needs:triage Issues that have not been investigated yet. scope:node Related to MSW running in Node

Comments

@charlieforward9
Copy link

charlieforward9 commented Jun 6, 2024

Prerequisites

Environment check

  • I'm using the latest msw version
  • I'm using Node.js version 18 or higher

Node.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.

Error: Network error
        at fetchTransferHandler (C:\Users\charl\Documents\Github\Agroview2.0\node_modules\@aws-amplify\core\src\clients\handlers\fetch.ts:24:10)
        at processTicksAndRejections (node:internal/process/task_queues:95:5)
        at retryMiddleware (C:\Users\charl\Documents\Github\Agroview2.0\node_modules\@aws-amplify\core\src\clients\middleware\retry\middleware.ts:28:28)
        at userAgentMiddleware (C:\Users\charl\Documents\Github\Agroview2.0\node_modules\@aws-amplify\core\src\clients\middleware\userAgent\middleware.ts:12:28)
        at Module.transferHandler (C:\Users\charl\Documents\Github\Agroview2.0\node_modules\@aws-amplify\api-rest\src\apis\common\handler.ts:56:18)
        at job (C:\Users\charl\Documents\Github\Agroview2.0\node_modules\@aws-amplify\api-rest\src\utils\createCancellableOperation.ts:25:14)
        at GraphQLAPIClass._graphql (C:\Users\charl\Documents\Github\Agroview2.0\node_modules\@aws-amplify\api-graphql\src\internals\InternalGraphQLAPI.ts:259:29)
        at C:\Users\charl\Documents\Github\Agroview2.0\src\core\store\api.ts:44:44
        at executeEndpoint (file:https:///C:/Users/charl/Documents/Github/Agroview2.0/node_modules/@reduxjs/toolkit/src/query/core/buildThunks.ts:226:18)
        at file:https:///C:/Users/charl/Documents/Github/Agroview2.0/node_modules/@reduxjs/toolkit/src/createAsyncThunk.ts:352:27

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

@charlieforward9 charlieforward9 added bug Something isn't working needs:triage Issues that have not been investigated yet. scope:node Related to MSW running in Node labels Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs:triage Issues that have not been investigated yet. scope:node Related to MSW running in Node
Projects
None yet
Development

No branches or pull requests

1 participant