FG
๐Ÿ’ป Software๐ŸŒ Web & Full-Stack

App keeps refreshing with log: `Server connection lost polling for restart`

Freshover 3 years ago
Mar 14, 20260 views
Confidence Score81%
81%

Problem

Describe the bug In certain situation the app keeps refreshing indefinitely giving this log in console: `server connection lost polling for restart`. I'm using vite 2.4.2 with https, react and typescript. Reproduction I noticed this happen in this 2 situations: 1. Using Brave with a CORS extension enabled on the page (in my case is CORS Unblock). Weirdly using Chrome with the same Chromium version and same extension doesn't cause the problem 2. Running `vite` with the `--host` flag and accessing it with my phone (Safari on iOS 14) via the shared url: `https://192.168.1.xxx:3000`. Removing the https option "solves" the problem on iOS. System Info [code block] Used Package Manager yarn Logs _No response_ Validations - [X] Follow our Code of Conduct - [X] Read the Contributing Guidelines. - [X] Read the docs. - [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate. - [X] Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/vue-next instead. - [X] Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
High Confidence Fix
77% confidence100% success rate5 verificationsLast verified Mar 14, 2026

Solution: App keeps refreshing with log: `Server connection lost polling for restart`

Low Risk

I'm having the same issue (vite 2.4.4). I run the vite server in a docker container, and use a reverse proxy to route the HTTPS traffic to this container. I already set `server.hmr.clientPort: 443`, but the app keeps refreshing. I even tried `server.hmr: false` to disable hmr entirely, still the same issue.

77

Trust Score

5 verifications

100% success
  1. 1

    I'm having the same issue (vite 2.4.4). I run the vite server in a docker contai

    I'm having the same issue (vite 2.4.4). I run the vite server in a docker container, and use a reverse proxy to route the HTTPS traffic to this container. I already set `server.hmr.clientPort: 443`, but the app keeps refreshing. I even tried `server.hmr: false` to disable hmr entirely, still the same issue.

Validation

Resolved in vitejs/vite GitHub issue #4259. Community reactions: 9 upvotes.

Verification Summary

Worked: 5
Partial: 1
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

vitebuild-tooljavascriptpending-triagefeat:-hmr