Service Workers - Consolidated issues list
Created by: ro-savage
This is a consolidation of issues and fixes service workers in CRA.
For general discussion of service workers see issue #2398 (closed)
Last updated: 18/06/2017 00:10:00 GMT
-
SWI1: Service workers are causing CRA to show up when someone hosts a non CRA app on the same address:host
.
PR #2551 attempt to address this by auto reloading non-service worker apps.
-
SWI2 User sees old app when revisiting a site, they must refresh to see the updated site.
PR #2426 attempts to address by showing a toast notifying user to refresh.
-
SWI3 service-worker.js can be cached accidently or by default on some hosts, meaning that new versions of apps do not appear until the cache period ends.
Eventually browsers should force no-cache on service workers, but this is only implemented in firefox currently. In the mean time, only fix is to ensure no-cache is set on service-worker.js
SW Spec Issue, Firefox
PR #2563 is a proof of concept how this could be addressed in CRA.
-
SWI4 Browser support is currently patchy. Different browsers support different specs and there is no polyfills to align browsers, things means developers need to be aware of browser differences
There is currently no fix for this.
-
SWI5 Odd behaviour for the end users when an app is cached but no data is loaded, images don't load etc
There is currently no fix for this. Developers must know of this behaviour an plan for it. Due to the fact users aren't allowed to fully configure the service worker, they won't ever be able to cache API data and images (I think? @jeffposnick).
A developer can store data in localStorage
and load that initially / if offline.
-
SWI6 When registerServiceWorker.js
is updated to fix issues, it will not be updated for current users of CRA. Breaking the 'as long as you don't eject you always have the latest features'
Currently no PR but we could move the logic out of registerServiceWorker.js and add it to react-scripts
config folder.
Please feel free to add any issues that you have encounter using CRA with service workers enabled.