You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Have you experienced this bug with the latest version of the template?
yes
Steps to Reproduce
follow stack setup guide
run npm run dev
navigate around app
check terminal console, see 404s for mockServiceWorker.js
Expected Behavior
Ideally there should be no 404s in the console
Actual Behavior
MSW requires users to run npx msw init public --save to create the service worker it uses for mocking. The default npm run dev runs with the mock server on, so msw checks for that file on some (most?) http requests.
Adding instructions to run that command to the docs should cover this use case - I'll open a PR soon to do that for discussion.
The text was updated successfully, but these errors were encountered:
@petecartwright I can't seem to reproduce the problem you're explaining here.
I can just run npm run dev and look around in the app without any problem.
Tagging @kettanaito (the creator/maintainer of MSW) to know if we would need to add the created public/mockServiceWorker.js file or not
Hey, folks!
You need to run msw init if you want to use MSW in the browser. To my best knowledge, this stack uses MSW primarily for third-party API mocking during integration testing, which runs in Node.js. Thus, there was never the need to generate the worker script via msw init.
Have you experienced this bug with the latest version of the template?
yes
Steps to Reproduce
npm run dev
mockServiceWorker.js
Expected Behavior
Ideally there should be no 404s in the console
Actual Behavior
MSW requires users to run
npx msw init public --save
to create the service worker it uses for mocking. The defaultnpm run dev
runs with the mock server on, so msw checks for that file on some (most?) http requests.Adding instructions to run that command to the docs should cover this use case - I'll open a PR soon to do that for discussion.
The text was updated successfully, but these errors were encountered: