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

[Vite] If you open a page while offline, the page reloads once you are back online #13116

Open
vursen opened this issue Feb 22, 2022 · 0 comments
Labels
enhancement vite Tickets related to vite support

Comments

@vursen
Copy link
Contributor

vursen commented Feb 22, 2022

Describe your motivation

A follow-up to #12928, #12383

In dev mode currently, if you open a page while offline, the page reloads once you are back online. The reload is caused by @vite/client that polls the Vite server every 1 sec and performs a full page reload as soon as the server becomes available.

Describe the solution you'd like

There are two options at least:

  1. Ask the Vite team for an API in @vite/client that we could use to control the polling process.
  2. When @vite/client is requested offline, patch it up on a fly by the service worker such that it won't poll the service in this case.

A related ticket in the Vite repo: vitejs/vite#6791

@vursen vursen added enhancement vite Tickets related to vite support labels Feb 22, 2022
@vursen vursen added this to To do in Frontend build optimization via automation Feb 22, 2022
@vursen vursen changed the title [Vite] A page reload happens when you go online on a page that was opened offline in dev mode [Vite] A reload occurs when you go online on a page that was opened offline in dev mode Feb 22, 2022
@vursen vursen changed the title [Vite] A reload occurs when you go online on a page that was opened offline in dev mode [Vite] If you open a page while offline, the page reloads once you are back online Feb 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement vite Tickets related to vite support
Development

No branches or pull requests

1 participant