Skip to content

Mock Server Returns HTML Instead of JSON in React Vite #2235

Answered by kettanaito
aramfilak asked this question in Q&A
Discussion options

You must be logged in to vote

I suspect this is #2115, #367, #1744. In essence, Chromium has their own Service Worker inactivity policy, and once they terminate MSW's worker, it cannot properly restart unless you refresh the page (reevaluate JavaScript).

There's one thing we can try on MSW's side but it depends on how Chrome reenables the worker (if it fires any events whatsoever for us to know). I suggest you follow the open issue I referenced for a solution. Thanks.

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
2 replies
@itallovidal
Comment options

@aramfilak
Comment options

Comment options

You must be logged in to vote
3 replies
@aramfilak
Comment options

@kettanaito
Comment options

Answer selected by kettanaito
@aramfilak
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants