vitejs / vite

Next generation frontend tooling. It's fast!
http://vite.dev
MIT License
68.16k stars 6.15k forks source link

maybe a bug of fast-refresh #6468

Closed hemengke1997 closed 2 years ago

hemengke1997 commented 2 years ago

Describe the bug

An error occurs when hmr are constantly triggered. I'm not sure if this is a fast-Refresh issue. Hope to get your answer, thank you very much!

Reproduction

https://github.com/hemengke1997/refresh-bug

Reproduction Step

  1. yarn && yarn dev
  2. constantly trigger hmr in src/Container.ts

System Info

System:
    OS: Windows 10 10.0.19043
    CPU: (6) x64 Intel(R) Core(TM) i5-8400 CPU @ 2.80GHz
    Memory: 1.11 GB / 15.87 GB
  Binaries:
    Node: 16.13.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.4 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 7.24.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.1266.0), Chromium (96.0.1054.62)
    Internet Explorer: 11.0.19041.1202
  npmPackages:
    @vitejs/plugin-react: ^1.0.7 => 1.1.4
    vite: ^2.7.2 => 2.7.10

Used Package Manager

yarn

Logs

No response

Validations

frog-o commented 2 years ago

I also have this type of problem with vue and vite-ssr plugin. Could you tell me how you know which file is causing the reload? I was tiring to use Vites-ssr plugin and use there scaffolding template. It is also contently refresh. I tried writing to Vites-ssr plugin about this and they closed the issue saying it is a vite problem without much investigation. I am very annoyed how people balm one another about problems but don't work on the problems. No mater who is to balm it is still an unpleasant user experience for people using there product. I also using yarn i don't know why. I was trying to enable PNP but it didn't work and I wrote them about it and they told me I have to make a better test case. I give up.

bluwy commented 2 years ago

An error occurs when hmr are constantly triggered

Can you show what the error is? I don't see any errors when testing out the repro

frog-o commented 2 years ago

Yes this is caused by vite not connecting to the websockets(Wich i did not know it was using) it was blocked by systemd. I was running it in a container. I had to do some real big digging to find out what it was. I had to change the value of the port that vite use and allow it to flow. It would be nice it vite would say you need to have to ports opened. The first one obvious the second not so much.

On Sun, Apr 3, 2022, 9:09 AM Bjorn Lu @.***> wrote:

An error occurs when hmr are constantly triggered

Can you show what the error is? I don't see any errors when testing out the repro

— Reply to this email directly, view it on GitHub https://github.com/vitejs/vite/issues/6468#issuecomment-1086865700, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALNZ2Z3GKAL7VMNIEN5MGKDVDGJ77ANCNFSM5LX77RAQ . You are receiving this because you commented.Message ID: @.***>

bluwy commented 2 years ago

Perhaps we can document this then. I know there has been friction for some users who use Vite inside Docker, and it would be nice to have an official guide on how to set it up. Feel free to contribute if you like!

frog-o commented 2 years ago

That would be great, thanks!

On Mon, Apr 4, 2022, 10:19 AM Bjorn Lu @.***> wrote:

Perhaps we can document this then. I know there has been friction for some users who use Vite inside Docker, and it would be nice to have an official guide on how to set it up. Feel free to contribute if you like!

— Reply to this email directly, view it on GitHub https://github.com/vitejs/vite/issues/6468#issuecomment-1087619676, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALNZ2Z5TFWJMMUR4STUK5S3VDL3ALANCNFSM5LX77RAQ . You are receiving this because you commented.Message ID: @.***>

sapphi-red commented 2 years ago

@bluwy Should this issue be closed as websocket error will be shown by #7111 and docker documentation is tracked at #4116?

bluwy commented 2 years ago

Make sense 👍