You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Vitest caught 1 unhandled error during the test run.
This might cause false positive tests. Resolve unhandled errors to make sure your tests are not affected.
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Unhandled Rejection ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
TypeError: response.body.getReader is not a function
❯ XMLHttpRequestController.respondWith node_modules/.pnpm/@mswjs[email protected]/node_modules/@mswjs/interceptors/lib/node/chunk-V3QPQ45S.mjs:452:36
❯ xhrRequestController.onRequest node_modules/.pnpm/@mswjs[email protected]/node_modules/@mswjs/interceptors/lib/node/chunk-V3QPQ45S.mjs:727:39
This error originated in "tests/tests.test.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running.
The latest test that might've caused the error is "request is ok". It might mean one of the following:
The error was thrown, while Vitest was running this test.
This was the last recorded test before the error was thrown, if error originated after test finished its execution.
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Same error using latest version 1.0.4.
It seems to have something to do with #4671.
Also mswjs/msw#1816 seems to be similar.
This happens because Vitest now respects happy-dom's Request and Response, and happy-dom uses Node.js Readable stream for a body. This class doesn't support getReader method.
I'd say this is an error on happy-dom side and not Vitest.
Describe the bug
I upgraded vitest to latest version, 1.0.2, and my tests using msw started to crash with the following message:
Same error using latest version 1.0.4.
It seems to have something to do with #4671.
Also mswjs/msw#1816 seems to be similar.
Reproduction
https://stackblitz.com/edit/vitejs-vite-wlzbz8?view=editor
Try it with vitest 1.0.1 - ✅ works
Try it with vitest >1.0.2 - ❌ breaks
System Info
Used Package Manager
pnpm
Validations
The text was updated successfully, but these errors were encountered: