vite: HMR does not work

Describe the bug

I see this HMR didn’t work for dynamic imported modules ,I also have this issue. but I have another problem in react.

for example:

my vit config:

image

my whistle: image

I will use “cms.fcc.qq.com” open the page.

my html: image

my component:

index.tsx use App.tsx: image

App.tsx: image image

when I change something in GLHeaderMenu component. this will show ‘[vite] hmr update /src/App.tsx’ .the page does not update image

hmr does not work .

Reproduction

System Info

Output of npx envinfo --system --npmPackages vite,@vitejs/plugin-vue --binaries --browsers:


Used package manager:

Logs



Before submitting the issue, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the docs.
  • Check that there isn’t already an issue that reports the same bug to avoid creating a duplicate.
  • Provide a description in this issue that describes the bug.
  • 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.
  • Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 20 (6 by maintainers)

Most upvoted comments

The cache may cause the problem.? I also use whistle just like you. can you tell me the reason of using http but not https? the page is refreshing continuely when I set the https in whistle even I set https: true in vite.config . Do you have the same promblem just like me?

see this:https://github.com/vitejs/vite/issues/2968

I encountered the problem you mentioned, because we use whistle. the websocket connection failed and caused the reswiping. see image

.You can solve this problem through the following configuration. image