-
-
Notifications
You must be signed in to change notification settings - Fork 529
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
Failed to fetch after first interception #1976
Comments
in my case, most time every request is ok when I login by form in the page, there's no request before I typing username/password and click to send the first request after msw mocked. If I refresh the page after login, there's a request for getting user info when vue router navigation, I'll got the same error, the request is send soon after msw mocked. the following login out request is successed. I try to downgrade to 2.0.14, erveything is ok. btw, if set |
This sort of looks like the symptoms reported in #1653 but the deferred render approach is not effective here as it was in 2.0.14. Edit: The bug was mine -- I'm running fine with 2.1.2 now. The snippet in the deferred render comment linked above is missing an |
In my case, I do see I have been trying to replicate this issue:
I was not able to replicate the |
same problem for me as well in version 2.1.2 |
@kettanaito I was able to replicate in the codesandbox links above, wherein the first load MSW intercepts the first call but after I refresh the browser, there is no more interception. |
For future reference found this post from @kettanaito on X
|
I'm going to close this. Next.js doesn't work well with MSW at the moment. Until I have a fully functional example as confirmation of that, Next.js is not supported. You can follow the progress of that example here: The Next.js team has also reached out to me to help address the remaining issues on Next.js side, so I hope to post some updates soon. |
Prerequisites
Environment check
msw
versionBrowsers
Chromium (Chrome, Brave, etc.)
Reproduction repository
N/A
Reproduction steps
(this is a migration from older version to latest)
start Next server
go to a page that makes an HTTP call that is listed to be intercepted
page refreshes and MSW fails to fetch after the first request is successful
Current behavior
when next/react triggers a new load cycle the calls
failed to fetch
Expected behavior
start Next server
go to a page that makes an HTTP call that is listed to be intercepted
page refreshes, msw intercepts consequent intercepted http calls
The text was updated successfully, but these errors were encountered: