Service Worker not detecting updates #821
Unanswered
IlariaCallegari
asked this question in
Q&A
Replies: 1 comment 4 replies
-
can you share the app url? |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I’m hoping someone can help 🆘 , as I’ve been struggling with this issue for the past week. We’ve been using VitePWA for over a year now, but since October last year, we’ve noticed a strange behavior in our production application.
When we release a new version, the service worker does not seem to detect the new version update. We use
generateSW
as our strategy and useregisterType: 'prompt'
, so a dialog box should appear prompting users to update to the new version.Lately though, the dialog box does not appear, or some users report an erratic behaviour: i.e. they click on 'update' and nothing happens. If a user clears the cache and hard reloads the browser, they will receive the latest version of the app. But as soon as they log out and back in again, the service worker will serve the old assets, rolling the app back to the previous version.
From my understanding, a hard reload does not clear service worker files, which might explain the rollback effect, but I don’t understand why the service worker is not detecting the update in the first place.
I’ve spent a good amount of time debugging, and the service worker appears to register correctly. Below is our current configuration:
Apologies in advance if this is a duplicated question, but I spent a good amount of time reading discussions on similar issues and tried the proposed solutions without any luck.
Any insights or suggestions would be greatly appreciated. Thanks! 🙏🏻
Beta Was this translation helpful? Give feedback.
All reactions