Skip to content
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

TypeError: Fetch event is destroyed. Safari bug tracked by Sentry after updating to latest whatwg-fetch@3.1.0 #790

Closed
JustFly1984 opened this issue Jun 30, 2020 · 10 comments

Comments

@JustFly1984
Copy link

IOS 13.5.1
Mobile Safari 13.1.1

error on attempt to load css file from same origin

Never seen error like that before today.

Screenshot 2020-06-30 19 58 43

I've posted by accident to whatwg/fetch#1048

@JakeChampion
Copy link
Owner

iOS 13 would be using a native fetch and not a polyfill. Are you sure it is using the polyfill?

@JustFly1984
Copy link
Author

@JakeChampion I'm sure I'm importing "whatwg-fetch": "3.1.0" polyfill before everything else in the code, and removing window.fetch for IE to fix bug:

<script type='application/javascript'>
          {'if(/Edge/.test(navigator.userAgent)){delete window.fetch}'}
        </script>

@JakeChampion
Copy link
Owner

I'm quite confused about this one because we don't have an error which uses the phrase "event is destroyed", which makes me think the polyfill is not being applied but the code you've posted makes me also think it can't be the native fetch due to delete window.fetch. Could you post the full stacktrace for the error please? That should hopefully help us figure out what is going on

@JustFly1984
Copy link
Author

@JakeChampion basically there is one async request for css file with fonts.
It looks like safari 13.1.1, and it happened only once by now.

Screenshot 2020-07-04 13 06 18

@JakeChampion
Copy link
Owner

Do you have the full stacktrace for the error? Sentry usually captures the full stack trace to help with debugging.

The stacktrace is usually between the "exception" section and the "breadcrumbs" section. If there is no captured stack trace then I don't know how to help debug this situation, sorry 😔

Here is a screenshot of what the sentry page looks like with a stacktrace
showing stacktrace on sentry for a captured exception

@JakeChampion
Copy link
Owner

Okay, looking into the webkit source code I can see the same error message "Fetch event is destroyed", which is an error message that we don't have in this fetch polyfill. I am very confident that for the specific fetch request, it used the native fetch and not the polyfill.

Here is the patch to webkit which added the error message -- https://www.mail-archive.com/webkit-changes@lists.webkit.org/msg129765.html

@dgraham dgraham closed this as completed Jul 7, 2020
@JustFly1984
Copy link
Author

So why didn't polyfill worked out?

@JakeChampion
Copy link
Owner

You are only deleting native fetch for edge but this bug was in native fetch for iOS

@JustFly1984
Copy link
Author

@JakeChampion If I remove window.fetch for IOS, should polyfill work in this case? Is there guaranty way to detect safari same way as I detect Edge?

@JustFly1984
Copy link
Author

@dgraham please reopen, cos there is no solution to resolve an issue. I understand that it is a bug with webkit, but is it possible to solve it by using fetch polyfill, and if yes, how?

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants