Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

service-worker cannot detect new version to update cache when using Link, NavLink in React #700

Open
thiencao-a6 opened this issue Apr 11, 2024 · 4 comments

Comments

@thiencao-a6
Copy link

thiencao-a6 commented Apr 11, 2024

i am using vite-plugin-pwa for my react app, it works well until i replace "a" tag to Link, NavLink(react-router-dom). My app cannot detect changing every i deploy new version. Hence, my app still display old contents if i don't reload page

@userquin
Copy link
Member

Use vanillajs or react virtual module, check the example in the examples folder: check the warning in the docs https://vite-pwa-org.netlify.app/guide/auto-update.html

I Will try to add a new internal recipe to reload all clients from the service worker (no idea if we can do that using generateSW strategy).

@thiencao-a6
Copy link
Author

Use vanillajs or react virtual module, check the example in the examples folder: check the warning in the docs https://vite-pwa-org.netlify.app/guide/auto-update.html

i have followed to this example, it is using "a" tag, i replaced to (Link, NavLink) and it didn't work anymore. I think because service-worker hasn't supported for "client side routing"

@userquin
Copy link
Member

What's your vite pwa configuration?

@thiencao-a6
Copy link
Author

thiencao-a6 commented Apr 18, 2024

What's your vite pwa configuration?

I mean i use example react-router in examples folder, just change "a" tag to Link in this file
vite-router-about

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants