-
-
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
fetchEvent.respondWith Receives an Error in Safari Only #558
Comments
While the root cause of the issue is related to #529, there's a different client retrieval logic happening in Safari. The following expression throws in Safari only: Line 193 in c45cf14
This can be fixed by determining the worker's client once, on the parent scope of the "fetch" event, and then reusing in both |
Upon further investigation, I can conclude that -event.target.clients.get(clientId)
+this.clients.get(clientId) That returns the same client instance, as we are requesting it by |
this is still happening... I am on safari Version 14.0.3 (16610.4.3.1.4) and "msw": "^0.25.0", on package json |
@dagadbm please update the |
Oh wow that was fast. Didn't know it was fixed so soon honestly. But I
thought the real problem was safari not supporting the respondwith method.
Also it is really not feasible for projects to be constantly updating their
dependencies.
Msw I give it a pass since it's a local host only thing but for other
things it's not really high on anyone's priority list due to time
constraints and so on.
Anyways keep up the good work here looking forward for 1.0!
…On Mon, Mar 1, 2021, 19:36 Artem Zakharchenko ***@***.***> wrote:
@dagadbm <https://github.com/dagadbm> please update the msw package,
you're using the same version that reported this issue. Generally, aim
towards using the latest package versions.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#558 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD7WGR7YRPSYKLDF3RNBPSLTBPUFBANCNFSM4WNK4ZJA>
.
|
Hi, thank you for your works. I'm experiencing this issue on Safari 15.3(17612.4.9.1.8) with msw 0.42.3 |
We seem to be having the same issue on a later version of msw. MSW v0.44.1 Firefox & Chrome work fine. Seem to only have issues with Safari 15.3 and below. |
@kodai3, perhaps. As always, I'd suggest updating @fillie, what about Safari 15? We don't really promise support on all versions of all browsers, as those versions can implement the Service Worker spec differently. There isn't enough manpower to promise such support, sorry. If it works on the latest version, then I conclude it working. |
Environment
Request handlers
Actual request
Current behavior
On Chrome & Firefox, everything is fine. In Safari, it seems like the request gets intercepted, as I see the mock response in the console, but then the service worker throws an error, causing the
fetch
call to catch with error[Error] FetchEvent.respondWith received an error: Returned response is null.
(see screenshot). Not sure why it's trying to connect tolocalhost:8642
. That's the local server I run when not using mocks.Expected behavior
The
fetch
should return the mock response and not throw an error.Screenshots
The text was updated successfully, but these errors were encountered: