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

Safari bug #1730

Closed
dijonkitchen opened this issue Oct 23, 2018 · 15 comments
Closed

Safari bug #1730

dijonkitchen opened this issue Oct 23, 2018 · 15 comments
Labels
Browser Compatibility Tied to service worker behavior in a specific browser.

Comments

@dijonkitchen
Copy link

dijonkitchen commented Oct 23, 2018

Library Affected:
workbox-sw, workbox-build, etc.?

Browser & Platform:
Safari 12
macOS High Sierra 10.13.6

Issue or Feature Request Description:
Refreshing workbox PWAs (like https://material-ui.com) leads to this sometimes.

Safari cannot open the page. The error was: "FetchEvent.respondWith received an error: Returned response is null. (WebKitServiceWorker: 0)"

Console has:

Failed to load resource: bad URL safari-resource:/page-load-errors-extras.css

Confirmed that they work fine on Firefox, Chrome and private mode Safari.

I figured if I cleared the cache, it would help, but it doesn't seem to kill the service workers.
Workaround is to disable service workers in Developer mode and I can load the websites properly.

@jeffposnick jeffposnick added Needs More Info Waiting on additional information from the community. Browser Compatibility Tied to service worker behavior in a specific browser. labels Oct 23, 2018
@jeffposnick
Copy link
Contributor

I just testing things out on Safari 12 on the desktop, and was not able to reproduce after navigating around to a few pages controlled by the service worker on https://material-ui.com. So, if there are any concrete reproduction steps that you've been able to narrow down, I'd love to dig in deeper.

In the meantime, though, I've noticed that you're using a v3.0.0 pre-release version of Workbox. Workbox is up to v3.6.3 now (and we've got v4 alphas out), so as a first step, could you try upgrading your copy of Workbox? There were a number of improvements made throughout the v3 releases, and I'd like to at least make sure that we're starting from the latest codebase.

@dijonkitchen
Copy link
Author

Thanks @jeffposnick, I don't control the site, so I'll cross-post there.

@dijonkitchen
Copy link
Author

@jeffposnick did you also trying refreshing pages? This should be when the Service workers do their work using the cache instead of routing through the single-page app.

@jeffposnick
Copy link
Contributor

Yes, I've tried a few times now to go through full navigations as well as page reloads and trigger any failures in Safari 12. I've not had any luck.

(That's not to say that there isn't an issue; it's just that odd bugs can crop up in browsers' implementations of service workers that are hard to trigger.)

@NekR
Copy link

NekR commented Oct 24, 2018

@jeffposnick
Copy link
Contributor

As per the initial issue report, I was working under the assumption that this was being seen on the desktop (Safari 12 / macOS High Sierra 10.13.6).

@NekR
Copy link

NekR commented Oct 24, 2018

@jeffposnick hmm.. yeah, indeed. Then it must be the same bug on macOS as well because the error line is the same as on iOS when this happens.

@dijonkitchen
Copy link
Author

Yes, my error was on macOS Safari. For what it's worth, I tried it out on another laptop that recently upgraded to macOS Mojave and Safari there was fine.

@oliviertassinari
Copy link

We gonna start by upgrading the version of workbox on material-ui side.

@oliviertassinari
Copy link

oliviertassinari commented Nov 6, 2018

We have been upgrading the version of workbox from the beta to the latest version. It hasn't gone smoothly, a lot of people were facing cache invalidation issues. This is something that happens quite often every time we release a new version. It takes time to propagate. The cache invalidation is an important limitation of the service workers.

I'm suspecting it's because of the next service worker waiting for its activation. Maybe there is a way to force it? At the expense of an unexpected full page reload when the user tries to refresh the page or to navigate to a different page. I will explore this path: https://developers.google.com/web/tools/workbox/guides/advanced-recipes.

@dijs
Copy link

dijs commented Nov 14, 2018

Our team recently found this issue as well. Is the solution to upgrade workbox?

@jeffposnick
Copy link
Contributor

Our team recently found this issue as well. Is the solution to upgrade workbox?

The material-ui site was using a very outdated Workbox v3 beta, so updating was a good idea in general.

More recent versions of Workbox have had better "cache miss" fallback logic to take into account the fact that items that should be precached aren't necessarily going to be there (due to browser bugs, or other failure scenarios), so they are more robust about at least showing something from the network when this crops up, instead of just failing to load the cached response.

But in general, my understanding is that this underlying issue a bug in Safari and is outside of Workbox's control, and which is being tracked by the Webkit bugs linked to above.

@jeffposnick jeffposnick removed the Needs More Info Waiting on additional information from the community. label Nov 19, 2018
@jeffposnick
Copy link
Contributor

Closing this in favor of #1744 (which I also hope to close, if folks can confirm that the latest iOS/Safari combination has addressed the issues they were seeing).

@Alfsuper
Copy link

Today I have the same problem as you in another link, the same error text. But when I change the link from the wireless connection from my router to my phone, no problem, it works. The router configuration has some protection because when I connect to the wifi of my phone the link to the web is fine, I hope that if this is helpful even if it has been a long time, greetings to all.

@iambenmitchell
Copy link

iambenmitchell commented Apr 5, 2021

I am getting the same issue with

http://ipv6-test.com/button-ipv6-small.png

Safari:
image

Chrome:
image

Solution:

The server supports SSL / HTTPS anyways so adding an S to the end of http fixes the bug, no other work required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Browser Compatibility Tied to service worker behavior in a specific browser.
Projects
None yet
Development

No branches or pull requests

7 participants