Closed YuesIt17 closed 2 months ago
Hi, @YuesIt17.
Your first example shows that you forgot to await worker.start()
. Once you do, all the requests will be intercepted and mocked as you expect. Here's the fix:
// main.jsx
-worker.start()
+await worker.start()
Hello! I have a problem with Msw + vite.
I have tried install latest version 2.4.2 and msw doesn't watch mock of api, i.e. i can not get into the handler of mock. But I see in console "[MSW] Mocking enabled" and if you request the api again, then i get data from mock handler.
Example with bug
If you install for example "msw": "2.0.4", i don't have this problem