pcb
pcb copied to clipboard
Infinite reloading on Chrome for iPhone
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
Changing from:
require("offline-plugin/runtime").install();
to:
if ('serviceWorker' in navigator) {
require("offline-plugin/runtime").install();
}
solved it
@matheusml thanks for updating with the solution, sent a PR to add this to the docs.
install()
method as 'serviceWorker' in navigator
check inside.
@matheusml which version of iOS and which version of offline-plugin
?
@NekR I'm sorry but I don't have this information anymore :(
@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?
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..