Skip to content
This repository has been archived by the owner on Dec 21, 2018. It is now read-only.

Service Worker breaking changes in Chrome 59 and Firefox #36

Closed
2 tasks
Splaktar opened this issue May 5, 2017 · 9 comments
Closed
2 tasks

Service Worker breaking changes in Chrome 59 and Firefox #36

Splaktar opened this issue May 5, 2017 · 9 comments
Assignees

Comments

@Splaktar
Copy link

Splaktar commented May 5, 2017

In Chrome 59, the navigation to "https://devfestflorida.org/" will result in a network error, because FetchEvent.respondWith() was called with a redirected response. See https://crbug.com/658249. The url list of the response was: ["https://devfestflorida.org/index.html?sw-precache=d29f0089363aaf48cd80c928c9628029", "https://devfestflorida.org/?sw-precache=d29f0089363aaf48cd80c928c9628029"]

[Deprecation] The service worker responded to the navigation request with a redirected response. This will result in an error in M59, around June 2017.

  • Check if this is fixed in Hoverboard latest baseline
  • Update sw-precache and whatever else is needed to resolve this
@Splaktar
Copy link
Author

Splaktar commented May 5, 2017

Tested on Chrome 60 (canary) and the site didn't load at all.

devfestflorida.org/:1 GET https://devfestflorida.org/ net::ERR_FAILED

@Splaktar
Copy link
Author

Splaktar commented May 5, 2017

We can't just update to the latest Hoverboard since their develop branch (gdg-x#230) that is working towards v1.2.0 drops support for Localization (gdg-x#243) of the site which we use for a Spanish version.

@Splaktar
Copy link
Author

Splaktar commented May 5, 2017

This issue seems to be tracked in gdg-x#149.

Part of the fix is here: gdg-x@d75b2d3. But it is built on top of a number of breaking changes in a very large PR for v1.2.0 (gdg-x#235).

@Splaktar Splaktar self-assigned this May 5, 2017
@Splaktar
Copy link
Author

Splaktar commented May 5, 2017

The root issue seems to be with sw-precache and it was fixed in GoogleChromeLabs/sw-precache#241 which is tagged in v5.0.0.

@Splaktar
Copy link
Author

Splaktar commented May 5, 2017

polymer-cli v0.18.1 (https://github.com/Polymer/polymer-cli/blob/v0.18.1/package.json) is dependant upon polymer-build v1.1.0. polymer-build v1.1.0 (and v1.2.0 and v1.2.1) (https://github.com/Polymer/polymer-build/blob/v1.1.0/package.json) is dependant upon sw-precache ^4.2.0 which doesn't have the fix to support Chrome M59.

Splaktar added a commit that referenced this issue May 5, 2017
polymer-cli v0.18.0 and v0.18.1 aren't supported yet
add @polymerBehavior annotations and missing imports
minor fixes to sw-precache-config
fix breaking changes to polymer.json

Relates to #36
@Splaktar Splaktar assigned miketraverso and unassigned Splaktar May 6, 2017
@Splaktar
Copy link
Author

Splaktar commented May 6, 2017

I made some changes for this in this branch which included merging in v1.1.2 of Hoverboard and getting the build working with polymer-cli v0.17.0. Unfortunately while that worked on Chrome, the combination does not render anything at all on Firefox or Safari.

I tried to get the builds working for polymer-cli v0.18.0 and v0.18.1 but there were too many bugs in polymer-cli and polymer-build that still need to be solved on their end. Either way, as mentioned above, since polymer-build still doesn't use sw-precache v5.0.0+ this issue will still occur until https://github.com/Polymer/polymer-build/issues/199 is fixed and made available in polymer-cli.

@miketraverso has asked me to stop working on this since he will be taking it over.

Recommended Solution

Removing Service Worker completely may be the best short term solution until the Polymer team gets things caught up with Chrome. That might be another 3-6 months though.

Alternative Solutions

  1. Get rid of our Spanish localized version of the site and merge in Hoverboard's develop branch (with the changes for the unreleased v1.2.0) which contains the fix.
  2. Stop using polymer-cli like Hoverboard v1.2.0 does and implement a custom build. This likely would involve just doing the first step here and then re-implementing all of the Localization behaviors and config. Not recommended.

As I mentioned in Slack today, going back to an old version of Hoverboard won't work since it's Service Worker implementation will be even more broken and unsupported in Chrome M59+ and Firefox.

@Splaktar Splaktar changed the title Service Worker breaking changes in Chrome 59 6/17 Service Worker breaking changes in Chrome 59 and Firefox May 8, 2017
@Splaktar
Copy link
Author

Splaktar commented May 8, 2017

There is now a PR (Polymer/polymer-build#201) to fix this in polymer-build. That will still need to be released, then polymer-cli will need to pick up the latest polymer-build and do a release, then we would need to upgrade this project to work with the latest polymer-cli (numerous breaking changes).

Another alternative is to merge in the latest Hoverboard develop (v1.2.0) and just update to the newly released polymer-build (once it is released). This is because they removed polymer-cli in that branch/version of Hoverboard. Though this will require a number of breaking changes as well.

Or as mentioned above, we can just disable/remove the Service Worker from the site.

@Splaktar
Copy link
Author

GoogleChromeLabs/gulliver#325 details some strategies for killing a misbehaving SW.

@Splaktar
Copy link
Author

Closing as we no longer use this repo for the website.

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

2 participants