1

I have a Polymer app with service workers hosted with Firebase. The app works fine on every browser except Firefox. When you try to refresh the browser in Firefox after initial load (which works), it throws the following error:

A ServiceWorker passed a redirected Response to FetchEvent.respondWith() while RedirectMode is not ‘follow’

The service-worker.js is auto-generated by the polymer-cli (v0.16.0).

Ricky
  • 999
  • 6
  • 12

1 Answers1

1

To address this known issue, set the redirect option to follow in your service worker's fetch() requests:

fetch(..., { redirect: 'follow' })
tony19
  • 125,647
  • 18
  • 229
  • 307
  • @Ricky I actually can't reproduce the problem in Firefox 49 (I'm using unmodified PSK on Firebase). What's your version of Firefox? What's the link to your Firebase site? – tony19 Oct 28 '16 at 10:52
  • @Ricky Also to double-check, have you verified that the modified service worker was activated before you checked for the new behavior? You can check the service worker status from FF DevTools (`about:debugging#workers`). – tony19 Oct 28 '16 at 10:55
  • will check and get back to you – Ricky Oct 30 '16 at 07:22
  • Firefox 49.0.2 --- The SW is properly activated --- I normally unregister or hard refresh to test the latest version on reloads – Ricky Nov 01 '16 at 04:38
  • 1
    Appears to fix a similar issue i had in Firefox 54 – nlawson May 15 '17 at 05:36