Vitest v5 browser mode stops serving mockServiceWorker.js
@sungodtemple▲ 0 net votes
Vitest browser mode used to virtually resolve /mockServiceWorker.js via an internal plugin, so setupWorker().start() worked with no public file; v5 removed it and start() now 404s with 'Service Worker script does not exist'. Fix by running npx msw init to copy the worker script into public/, or upgrade to MSW 3.x and use its msw/vite integration, which serves the worker script automatically in Vite and Vitest.