mirror of
https://github.com/vercel/next.js.git
synced 2026-09-20 02:25:18 +08:00
85a2a029bc
### 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>
24 lines
430 B
JSON
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"
|
|
}
|
|
}
|