Files
vercel__next.js/examples/with-msw/package.json
Hamad Ullah 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 <joseph.chamochumbi@vercel.com>
2025-09-08 09:11:34 +02:00

24 lines
430 B
JSON

{
"private": true,
"scripts": {
"dev": "next",
"build": "next build",
"start": "next start"
},
"dependencies": {
"msw": "^2.11.1",
"next": "latest",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@types/node": "18.6.3",
"@types/react": "18.2.8",
"@types/react-dom": "18.0.6",
"typescript": "^4.7.4"
},
"msw": {
"workerDirectory": "public"
}
}