Search code examples
javascriptvue.jsversion-controlvuetify.jsweb-deployment

VueJs Deployment Problem: Chrome caches old version and not updating app


I'm having a problem with deploying my project. It's VueJs project, a web app, build on Metronic template with Vuetify components. When I publish, I use visual studio code with npm run build and upload the dist folder to my server. I have a version-check problem. Some of my clients cannot get the latest version, without hard reloading. ctrl-shift-r they are using chrome and when incognito mode is on everything is perfect. But normal mode brings a very old version of the app. I need a solution on the code or server-side, thank you for your help


Solution

  • I solved my problem and I forgot to post my answer. My problem was because of the PWA package I installed and implemented in the beginning of the project.

    When I try to remove PWA from my project, what I did was commenting the code blocks but not removing dependency from my packacge.json.(mistake) So, I was thinkin, *"Since I'm not calling any of the PWA functions or initialize it, it should've been removed." yeah, not. It was still there, caching stuff. So I removed (uninstalled) the dependency from my packacge.json, and even after that, people who did installed PWA before and "not uninstalled properly" was still using cache! (yeah, you have to click uninstall and also check remove files option) so I had to, manually uninstalled my PWA app from their chrome (thankfully it was only few) and problem solved.