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

Prompt- Reload - not reloading #717

Closed
elvince opened this issue May 22, 2024 · 4 comments · Fixed by #747
Closed

Prompt- Reload - not reloading #717

elvince opened this issue May 22, 2024 · 4 comments · Fixed by #747

Comments

@elvince
Copy link

elvince commented May 22, 2024

Hi,

Thanks for this plugin.

I follow all the instructions and look at your react samples on how to implement the update prompt.
Everything is working as expected except the "reload" part.
When I call updateServiceWorker(true), nothing hapenned. I had to call window.location.reload(); for the refresh to happenned.
Without the reload part, even a "normal F5 refresh" was not working as if the worker was in a waiting state and can't move out of it.

Any hints?

Just in case it helps, during the build I had a warning on my main js file that won't be precached. Configure maximumFileSizeToCacheInBytes to change this limit.

Thanks,

@userquin
Copy link
Member

Try to provide a minimal reproduction, you can use the new create-pwa https://vite-pwa-org.netlify.app/guide/scaffolding.html

About the warbing : https://vite-pwa-org.netlify.app/guide/faq.html

@elvince
Copy link
Author

elvince commented Jul 16, 2024

Hi,
Sorry for the later answer.
I already followed your documentation.

I'm not able to recreate a repro project as the issue is not 100% reproductible.
What I observed is that our main index.js file is pretty huged (few Mb), and when an update is released, the browser worker service is 'in waiting' state forever.

It happened when you already opened the app or when you load the app.
For example:
I'm in V0, i closed the tab browser, I push a V1, I reopen the tab browser and I have a gray screen.
If I look at the the netwrok panel, the indexXXXXX.js is in 404 (because the hash has changed) and the worked is in "waiting". As a consequence our users are stuck. F5/Refresh does not change anything, you must do a CTRL+ F5 or close/reopen your browser for the app to work.

Any idea?

My 2 cents:
It sound like the events sequence because update/refresh, waiting is failing somewhere and that's why we are stuck forever.
It might be due to the fact that the index file is not cached (due to its size), so something is not working as expected in the event sequence. No cache, means you might try to read the file, but it doesn't exist (404) as the hash changed and it stuck somewhere?

thanks for your insight.

@mpaland
Copy link

mpaland commented Aug 23, 2024

@elvince, have you solved it? Cause our index.js is 2.5MB and reload (prompt setting) does not work either.

@userquin
Copy link
Member

@mpaland any asset greater than 2MiB won't be added to the sw precache, check https://vite-pwa-org.netlify.app/guide/faq.html#missing-assets-from-sw-precache-manifest

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