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

Bug with Next.js App Router in Server Component - Mocking stops working after refreshing #1610

Closed
4 tasks done
Kolby-Udacity opened this issue May 6, 2023 · 1 comment
Closed
4 tasks done
Labels
bug Something isn't working needs:triage Issues that have not been investigated yet. scope:node Related to MSW running in Node

Comments

@Kolby-Udacity
Copy link

Prerequisites

Environment check

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

Node.js version

16.20.0

Reproduction repository

https://github.com/Kolby-Udacity/msw-nextjs-app-router-bug

Reproduction steps

  • npm i
  • npm run dev
  • refresh page
  • error

Current behavior

When using MSW with React Server Components via Next.js App Router, mocks work for the first page load, but refreshing the page will return a server error:

[MSW] Error: captured a request without a matching request handler:

  • GET http://localhost:59761/

Expected behavior

Mocks continue to work after refreshing the page.

@Kolby-Udacity Kolby-Udacity added bug Something isn't working needs:triage Issues that have not been investigated yet. scope:node Related to MSW running in Node labels May 6, 2023
@kettanaito
Copy link
Member

Hey, @Kolby-Udacity. Thanks for reporting this. MSW doesn't support Next 13 at the moment so we won't accept issues until we provide the official support. Sorry for the inconvenience but hope for your understanding. We have very few resources to figure out integration with all the new releases of all the new tools, so our best bet is to join forces with the Next team to help us out. I hope that will happen.

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

2 participants