pcb icon indicating copy to clipboard operation
pcb copied to clipboard

Infinite reloading on Chrome for iPhone

Open matheusml opened this issue 6 years ago • 7 comments

For some reason, OfflinePlugin is causing an infinite reloading, on the first page of the application, only on Chrome for iPhone.

This is the config:

// index.js
require("offline-plugin/runtime").install();
// webpack.js
new OfflinePlugin({
  externals: ["/"],
  responseStrategy: "network-first"
 })

When I remove the require("offline-plugin/runtime").install(); line, it works just fine.

Again: this is only happening on Chrome on iPhone

matheusml avatar Jul 10 '18 18:07 matheusml

Changing from:

require("offline-plugin/runtime").install();

to:

if ('serviceWorker' in navigator) {
  require("offline-plugin/runtime").install();
}

solved it

matheusml avatar Jul 18 '18 00:07 matheusml

@matheusml thanks for updating with the solution, sent a PR to add this to the docs.

GGAlanSmithee avatar Jul 25 '18 08:07 GGAlanSmithee

install() method as 'serviceWorker' in navigator check inside.

NekR avatar Sep 29 '18 19:09 NekR

@matheusml which version of iOS and which version of offline-plugin?

NekR avatar Sep 29 '18 19:09 NekR

@NekR I'm sorry but I don't have this information anymore :(

matheusml avatar Sep 30 '18 12:09 matheusml

@NekR Seems like serivce worker is not implemented on chrome on iOS: https://stackoverflow.com/a/50611655, so there might be an actual issue with the feature detection? Maybe this line?

GGAlanSmithee avatar Oct 01 '18 05:10 GGAlanSmithee

I'll need to test that. It seems to me like it might be an AppCache issue. Which is disabled by default though in v5..

NekR avatar Oct 01 '18 06:10 NekR