Recently i started getting this error for mock service worker (msw) in my react project.
Details:
- Node v16.19.1
- vite/3.2.6 linux-x64 node-v16.19.1
- react 18.2.0
Checked google, github issues but no good.
Recently i started getting this error for mock service worker (msw) in my react project.
Details:
Checked google, github issues but no good.
Copyright © 2021 Jogjafile Inc.


This error is caused by the
graphqlpackage releasing a build that cannot run in the browser. Since MSW depends ongraphql, the error surfaces for you when you try to run MSW in the browser.The issue has been resolved in the
graphqlpackage, although I've heard that it has regressed since then and you have to pin thegraphqlversion in order for it to remain fixed.[email protected]seems to be fixing this issue.You can use
overrideswith NPM (andresolutionswith Yarn) to pin that module's version in place:Hopefully, this won't regress on the latest GraphQL package and you will be able to use MSW without errors.