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

Msw is not working with NextJS app directory #1565

Closed
1 task
mcAnastasiou opened this issue Mar 16, 2023 · 1 comment
Closed
1 task

Msw is not working with NextJS app directory #1565

mcAnastasiou opened this issue Mar 16, 2023 · 1 comment
Labels

Comments

@mcAnastasiou
Copy link

Scope

Improves an existing behavior

Compatibility

  • This is a breaking change

Feature description

Previously the msw was working perfectly with NextJS. NextJS introduced a new structure called app directory. It seems that requests made on server side components are not intercepted by msw anymore. Could you fix this or propose a solution to this?

@kettanaito
Copy link
Member

Hi, @mcAnastasiou. Thanks for raising this.

There is no official way to use MSW with the new NextJS 13, which is still in beta. We've raised this discussion with the Next team, as they've removed the logic that'd allow executing code once for server/client with their new directory structure. That's the main challenge to make MSW work with it at the moment.

You can follow the progress in the mentioned issue: vercel/next.js#43284 (comment)

I will close this one because it's not a problem with MSW. It's a problem of missing proper integration point on the Next's side.

@github-actions github-actions bot locked and limited conversation to collaborators Nov 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants