-
Notifications
You must be signed in to change notification settings - Fork 27k
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
with-msw: Cannot use fetch in node? #37300
Comments
Any update, please? |
Had the same issue, switched from node v18 to v16 as a temp workaround. |
Oh yeah. I remember that MSW works on v16. Maybe we need just wait or switch to v16. |
MSW doesn't support Node.js 18 yet. There's a big effort around that support from our contributors (see mswjs/msw#1388). For now, use a supported Node.js version range, which is v14-v17. |
This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
UPDATE: Maybe it is a bug(?) of MSW. @s-bilic tell me that we can switch node's version from v18 to v16. I never try. But I promise that I will try tonight (tonight in my area 🤣 ).
Done. This works. It is not a bug of next.js, it is a... emmm... bug(?) of MSW.
Verify canary release
Provide environment information
I also try in
[email protected]
.Which example does this report relate to?
with-msw
What browser are you using? (if relevant)
Firefox (100.0.2). Chrome(101.0.4951.41 beta)
How are you deploying your application? (if relevant)
Just
next
Describe the Bug
I run the code below:
Then it raises two errors. The second tells me that the msw needs be inited. So I run code below:
And now it only raise one error:
Expected Behavior
I hope there is no error at all.
To Reproduce
By the way, I still do not get why we need to use the function
fetch
in node.js environment...The text was updated successfully, but these errors were encountered: