-
Describe the bugToday our working configuration for hot module reloading stopped working. We have a Vite app running in a Docker container. When a src file changes, the app does not reload. Reproductionhttp://example.com/DOCKER_ISSUE Steps to reproduceRun Place the scaffolded contents in a subdirectory called Add the below
Add the below vite.config.jsx
Place the following
Run Changes to the source code are not hot-reloaded System InfoSystem:
OS: Windows 10 10.0.19045
Binaries:
Node: 18.18.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.21 - ~\AppData\Roaming\npm\yarn.CMD
npm: 10.2.3 - ~\AppData\Roaming\npm\npm.CMD
Browsers:
Chrome: Not Found
Edge: Chromium (122.0.2365.66)
✔ Container vite-project-app-1 Recreated 0.1s
|
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 10 replies
-
Vite does not load |
Beta Was this translation helpful? Give feedback.
-
For some reason, the correct configuration for HMR in Docker is now
I wish I knew what happened to break all my apps, but this fixed it |
Beta Was this translation helpful? Give feedback.
-
Vite hot module reloading does NOT work consistently in Docker. See #16102 (comment) for possible fix Some Further complicating this issue, sometimes the same configuration works one day, and stops working the next. Sometimes two users on the same OS, will need two different |
Beta Was this translation helpful? Give feedback.
-
I am facing the same issue, last week HMR stopped working. |
Beta Was this translation helpful? Give feedback.
-
I'm facing a similar issue for the past few weeks. When I change only one file at a time, everything works fine. But when I change two or more files and save them together, only one file updates in the UI with HMR. Also, refreshing the Page without cache doesn't resolve the issue. I have to change the incorrect files again to get them updated. However, inside the Docker container, all files are changed, and their update timestamps are correct. Interestingly, if I use Vite's local server without Docker, I don't encounter these issues, so it's definitely related to Docker. I'm not sure if |
Beta Was this translation helpful? Give feedback.
Vite hot module reloading does NOT work consistently in Docker. See #16102 (comment) for possible fix
Some
vite.config.js
configurations work for one machine, while other configurations work for other machines. This is a machine specific problem, because the issue is sometimes reproducible across Windows, Mac, and Linux (Debian and Ubuntu).Further complicating this issue, sometimes the same configuration works one day, and stops working the next. Sometimes two users on the same OS, will need two different
vite.config.js
to enable HMR in Docker.