-
-
Notifications
You must be signed in to change notification settings - Fork 473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
worker.start() fails if there is no process or process.env #609
Comments
It would be great if we can use the library in the browser without pre-transforming it, or having to set |
Hi, @thehuijb. Thanks for reporting this. Can you please share a repository where this issue happens? I can't seem to reproduce it using a React application, so the more I know about your setup the better. |
@kettanaito I just encountered this issue today working with @LarsDenBakker 's web-dev-server. The issue is that its expecting Heres the simplest reproduction repo I could make: |
Hey, @ParamagicDev. Thank you for preparing the repo! So it sounds like the end build contains That's an intricate one: we don't use |
Web dev server doesnt actually run any build at all, it picks up the es module distribution and serves it to the browser as is. Since process is a node js global, it wont work in the browser. |
Describe the bug
msw is not working with the latest version, it works if I revert back to 0.25.
apparently a process.env variable is needed, and I do not have one.
Environment
msw: 0.26.2
To Reproduce
Steps to reproduce the behavior:
worker.start()
fails with following error:inspection shows the that
process
is required, see this part of the code found in graphql-deps.js at line 790:Expected behavior
I would expect the mocking to work as it did with version 0.25
using a serviceworker on a web project, I would not expect to need process.env.
The text was updated successfully, but these errors were encountered: