vite-plugin-pwa
vite-plugin-pwa copied to clipboard
Expected behavior on React Router example
Hi,
I'm not sure what is the expected behavior on React Router example. I run it using:
✔ Select a framework: › react
✔ Select a strategy: › generateSW
✔ Select a behavior: › Prompt for update
✔ Enable periodic SW updates? … yes
✔ Unregister SW? … yes
Then I go to https://localhost, the app is running fine, the SW is installed in the browser and activated. Then I edit a TSX file, which (as far as I know) rebuild the app and update the SW.
Using periodic SW updates, I expected that I would get the prompt after 20 secs max, but I don't see anything, I don't have any error in the console.
Chrome is telling me that #12 is redundant
when I refresh the browser.
What do I miss?
Why are you unregistering the sw? you should enable it on last run (once tested, after first 2 runs):
- run 1: react + generateSW + Prompt for update + Enable periodic SW updates (open page)
- run 2: stop run 1, change TSX file then run examples cli again with same configuration in run 1, prompt should be shown
- run3: stop run 2, and run examples cli again enabling Unregister SW, SW should be
#<id> is redundant
in dev tools