Files
85a2a029bc Fix/msw-issue-68521 (#83482)
### Fix: [68521](https://github.com/vercel/next.js/issues/68521)
Updating outdated with-msw example
The
[with-msw](https://github.com/vercel/next.js/tree/canary/examples/with-msw)
is outdated and doesn't work with the latest msw version.

### What?
The
[with-msw](https://github.com/vercel/next.js/tree/canary/examples/with-msw)
example is outdated and does not work with the latest msw version.

### Why?
- msw now uses http instead of rest and the outdated implementation does
not work with the latest version anymore.
- the client-side worker is now imported through msw/browser.

### How?
- replaced all usage of rest with http to align with MSW's new API.
- updated the worker import to use msw/browser as per the new structure.

### Media

https://github.com/user-attachments/assets/ab9ebb49-28b2-4095-aeea-dcd301093c9f

---------

Co-authored-by: Joseph <[email protected]>
2025-09-08 09:11:34 +02:00

5 lines
131 B
TypeScript

import { setupWorker } from "msw/browser";
import { handlers } from "./handlers";
export const worker = setupWorker(...handlers);