Vue-cli: Vue PWA doesn't update on iOS

Created on 13 Nov 2018  路  2Comments  路  Source: vuejs/vue-cli

Version

3.1.0

Reproduction link

https://github.com/mikeli11/vuepwaplugin

Node and OS info

Node 8.11.3 / Windows 10

Steps to reproduce

The issue is simple, I create a new project using vue-cli-3.1.0 and select the pwa plugin. I publish this app to netlify and add it to my homescreen on iOS12. I open the app and everything looks fine, I make an update and publish the site again. No matter how many times i open the app on iOS it is always showing the old version. This could be a Vue pwa plugin specific issue or with safari.

See it in action:
https://youtu.be/b197y8sMaKM

What is expected?

PWA is updated with the latest content.

What is actually happening?

PWA is still the older version of the app.

pwa upstream

Most helpful comment

@sodatea I fixed the issue by adding the skipwaiting:true option in the vue.config.js. After restarting the app on iOS, the latest version is now loaded.

workboxOptions: { skipWaiting: true }

Let me know if this helps you with your workbox issue. I don't know if this is the expected behaviour in Safari since this setting force installs the latest SW as soon as it's downloaded (which is not recommended). As you know already, chrome doesn't need this for the expected behaviour.

Reference:
https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin

All 2 comments

I'm also puzzled by this behavior.
Seems a Safari bug.

https://github.com/GoogleChrome/workbox/issues/1744

@sodatea I fixed the issue by adding the skipwaiting:true option in the vue.config.js. After restarting the app on iOS, the latest version is now loaded.

workboxOptions: { skipWaiting: true }

Let me know if this helps you with your workbox issue. I don't know if this is the expected behaviour in Safari since this setting force installs the latest SW as soon as it's downloaded (which is not recommended). As you know already, chrome doesn't need this for the expected behaviour.

Reference:
https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chasegiunta picture chasegiunta  路  3Comments

csakis picture csakis  路  3Comments

JIANGYUJING1995 picture JIANGYUJING1995  路  3Comments

Gonzalo2683 picture Gonzalo2683  路  3Comments

Akryum picture Akryum  路  3Comments