-
-
Notifications
You must be signed in to change notification settings - Fork 533
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
can't handle request for shared workers #1350
Comments
Hey, @njoel24. Could you tell me more about your setup? It's really hard to advise anything without knowing what/how you're trying to do. This condition is a part of the I don't have experience with shared workers. I'd be thankful if you contributed an integration test for that, which would reproduce the issue. Until then, I consider this issue closed for the lack of a reproduction scenario. |
Hey @kettanaito , thanks for your reply. In the issue I described there are no iframes involved, it might be something related on how the shared worker requests the resource. Yes, I will definitely create an integration test for that, so you will have more details. |
hey @kettanaito , I created an integration test for the issue: https://github.com/njoel24/integration-test-ms-shared-worker Here what the error should be in console: Please note that the handler has not been implemented and left as null because the error happens before. Kindly let me know if you need any more information. |
Released: v0.48.0 🎉This has been released in v0.48.0! Make sure to always update to the latest version ( Predictable release automation by @ossjs/release. |
Prerequisites
Environment check
msw
versionBrowsers
Chromium (Chrome, Brave, etc.)
Reproduction repository
not available
Reproduction steps
When trying to request a shared worker, the clientId attached to fetch event object is an empty string.
That causes the following line to break under mockServiceWorker.js in resolveMainClient function:
if(client.frameType === 'top-level')
I managed to make it work currently by checking for client like the following:
if(client && client.frameType === 'top-level')
With that I am able to work with shared worker.
Do you have any ideas why that happens?
msw version: 0.44.2
Thanks
Current behavior
the msw fails handling the request
Expected behavior
msw should handle the request.
The text was updated successfully, but these errors were encountered: