TypeError: unusable #2279
-
I'm upgrading MSW in a large project at work. We use it in our jest tests. I have followed the guidance and have my jest polyfills, utilizing undici. I have everything upgraded but several tests are failing with the following stacktrace below. I'm logging out several events from msw and it looks like all my requests are getting matched and mocked just fine, but still hitting this stack trace. Our UI uses axios as an API client and we are on latest msw and node 20.17. Does anyone have any potential ideas for me to look into? Trying to get a minimal repro together but figured I'd ask anyways
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
I too am getting the same error |
Beta Was this translation helpful? Give feedback.
-
This is a bug, you shouldn't be cloning a request body to read it by default. The fix is here #2282. Once it's merged, you can remove the |
Beta Was this translation helpful? Give feedback.
This is a bug, you shouldn't be cloning a request body to read it by default.
The fix is here #2282. Once it's merged, you can remove the
.clone()
call in your handler. Thanks.