Disabling "navigate" bypass causes TypeError: "Uncaught (in promise) TypeError: Failed to construct 'Request': Cannot construct a Request with a RequestInit whose mode member is set as 'navigate'." #2229
Labels
bug
Something isn't working
needs:triage
Issues that have not been investigated yet.
scope:browser
Related to MSW running in a browser
Prerequisites
Environment check
msw
versionBrowsers
Chromium (Chrome, Brave, etc.), Firefox, Safari
Reproduction repository
https://github.com/iulspop/msw-navigate-error
Reproduction steps
npm install
npm run dev
localhost:5173
/api/auth/login
Current behavior
On Chrome
When the handler runs it throws this uncaught error:
at
parseWorkerRequest.ts
:On Safari
Navigates to
http://localhost:5173/api/auth/login
and responds200 OK
withindex.html
body. Seems like worker doesn't run at all because it should print when intercepting request, maybenavigate
GET requests aren't intercepted by service workers on Safari and Firefox?mockServiceWorker.js
On Firefox
Same as Safari
Expected behavior
For the request handler defined for
api/auth/login
to respond with302
and redirect/
and set the cookie.The text was updated successfully, but these errors were encountered: