-
-
Notifications
You must be signed in to change notification settings - Fork 532
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
ERR_NETWORK: Vague Network Error in browser mode. #2398
Comments
downloadData
, only in browser mode.
Looking at more of my tests, it seems like the real problem is that my handlers are not properly intercepting/mocking the network calls. It appears to fire the request and match correctly, but not mock properly and end up somehow bypassing? Am I configuring the Please take a look at the sample repo so I can fix it and contribute it to an msw/example browser mode setup. Thank you |
I am also getting this at some places in my console when I run my tests...
i did not have any issues with any of the mocking when I was using the |
I'm hitting a seemingly similar issue while trying to use msw with vitest browser mode. My request handlers are being called, but ultimately msw is bypassing all requests, so all my mocked requests are resulting in 404 responses. |
I just realized that vitest browser is setting up its own msw request handler when |
@bdpartridge is it? Take a look at my reproduction. I don't use |
@charlieforward9 You're right. It looks like yours is a different issue. I tried out your reproduction and noticed that the
…I see the mocked 200 response for Anyway, sorry for adding noise to this thread. Good luck resolving this. |
@bdpartridge Yeah, I was under the impression that if we created the respective handler in msw, all network related operations would be skipped and handled by the msw handler. This is what is confusing me the most. Why am i getting network problems when implementing the mocks in msw? |
I mocked the preflight request with Could someone please point me to how to debug this better? I need to figure this out. EDIT: I dont see |
Prerequisites
Environment check
msw
versionBrowsers
Chromium (Chrome, Brave, etc.)
Reproduction repository
https://github.com/Agriculture-Intelligence/msw-vitest-browser-issue
Reproduction steps
aws-amplify
,vitest
,msw
vitest
andmsw
to support browser-based testing/mockingdownloadData
command fromaws-amplify/storage
moduleNETWORK ERR
Current behavior
Functional in development and node/jsdom testing, when configuration is changed to browser-based, fails.
Expected behavior
I expect the browser based mocking to work exactly the same as node based testing.
The text was updated successfully, but these errors were encountered: