might be need update docs for Vite setting #1077
ryota-murakami
started this conversation in
General
Replies: 1 comment 1 reply
-
Hey, @ryota-murakami! Thanks for reaching out. We don't currently have a Vite example in our examples. We do mention Deferred mounting recipe in the documentation for anybody who's faced with race conditions between their app making a request and the service worker registering. This looks exactly like what's happening in your case. I'm not sure if there's anything to update. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a OSS that React + TS Vite template and added msw setup recently. vite-react-ts-extended
I noticed that Vite's dev-server serving React code before msw Service Worker enabled within general setting like following screen shot(please see console log message orders).
So, I added Promise to ensure execute Service Worker registration code firstly, then msw working fine.
I guess this behavior relevant to dependency prebuild, there is no evidence though.
I'm not sure my above solution is ideal one, but I think we have to update for Vite's msw setting documentation.
Beta Was this translation helpful? Give feedback.
All reactions