vuejs / vue-cli

🛠️ webpack-based tooling for Vue.js Development
https://cli.vuejs.org/
MIT License
29.76k stars 6.33k forks source link

Vue PWA doesn't update on iOS #2945

Open mikejamesli opened 5 years ago

mikejamesli commented 5 years ago

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.

haoqunjiang commented 5 years ago

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

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

mikejamesli commented 5 years ago

@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