Vite and Docker
See original GitHub issueDescribe the bug
vite and docker dont seem to work well together every time i develop with both the browser reloads every minute. The browser reloads up to five time per initial load . Also the server crashes at random times during development .
Reproduction
https://github.com/louiss0/vue-2-template
System Info
docker-desktop 3.35
Used Package Manager
npm
Logs
No response
Validations
- Follow our Code of Conduct
- 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.
- 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.
Issue Analytics
- State:
- Created 2 years ago
- Comments:32 (4 by maintainers)
Top Results From Across the Web
Step By Step Guide To Dockerize React App Created Using Vite
In this post, you'll learn how to dockerize your react app created using the Vite tool for the development environment Docker is a...
Read more >Vite.js Docker Dev - GitHub
Vite.js Docker Dev uses the venerable make command to automate setup and access to the Docker containers used. See the Using Make &...
Read more >Starting up a new Vue 3 project with Vite and Docker
I'm enjoying new Vue 3 script setup syntax and blazing fast hot-reload using Vite. And as I'm using Docker containers for my development ......
Read more >vue.js - running a vite dev server inside a docker container
I have a Vue-cli app that I'm trying to convert to vite. I am using Docker to run the server. I looked at...
Read more >Docker - vite-plugin-ssr
Docker. In general, a vite-plugin-ssr app is just a Node.js server, so we can use any Node.js Docker container. Build. If we build...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@louiss0 's description maybe needs some editing, to be reproducible.
I’m also setting up Vite HMR with Docker Compose. The part where it still fails is HMR - I just don’t get any changes to the browser, if Vite is being run under Docker. If I run it natively, HMR works like magic.
This issue: Vite hmr does not work in Docker was specifically about HMR but is now closed.
Want to help solving these issues. My work is currently uncommitted, but will be available and reproducible soon.
I had the same problem and was able to fix it by setting a custom HMR port and exposing that port from the docker container.
server.hmr.port
config option to the port you want to use for HMR:docker-compose
)