New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Within a dev container using Docker 26, vite dev
or vite preview
cannot be accessed from the host
#16522
Comments
I had this same issue, there is a note about a windows container bug in the Docker release notes. They suggest using a But, the solution that worked for me was to run it with the
However, I am only able to connect via the first, localhost option (either EDIT: This issues seems only related to vite. When using another Docker dev Container, which exposes port 8282 to the host in a none vite environment, I am able to connect to the server correctly. Running vite with This can also be achieved by editing the server: {
port: 8002,
host: '127.0.0.1'
} I think that vite needs to change behaviour to use as default |
Vite currently isn't working in a Docker environment for development following along here: vitejs/vite#16522 Going to commit these files as placeholders, and probably still containerize the backend/db together even if I can't get Nuxt in there yet.
Could this be related to ipv4 and ipv6? The |
I just tried this, but was unable to connect over ipv6 via In my particular scenario, setting |
I tried this because I've tried upgrading and downgrading everything and nothing has worked this after I had rebuilt my dev container and these steps have not resolved my issue... |
Seems to do the trick for me. Having Vite using |
It seems docker v26 started to return |
Yes, using Again, I still think that setting |
Describe the bug
I initialy though this was a case of #11468 (comment), but it seems it is something else, so I am opening another issue.
Using Dev Containers for development, and after upgrading to Docker 26 (from 25) on the host, I am unable to connect to either
vite dev
orvite preview
server using the default and basic port forwarding feature of the dev containers.By "unable to connect", I mean that the server is launched, however when trying to connect from my host using
http://localhost:4200/
, either Chromium or Firefox Dev Edition request hangs indefinitely on loading (it stays in loading state without timing out for at least for a good 5-10 minutes; didn't test longer than that).I am using Nx, but using vite directly does not change the outcome.
For the recoard, I also have a
dotnet
server that is responding as expected to the request, so for now (in my limited available code base), this point out tovite
, but it may well be due to whichever node server backend vite is using.Reproduction
unable to provide without control of the host docker version
Steps to reproduce
No response
System Info
Dev Container
I am using a custom pre-built image, which is a copy of
mcr.microsoft.com/devcontainers/typescript-node:20
Host
docker-ce-cli (5:26.1.0-1~ubuntu.22.04~jammy)
docker-ce (5:26.1.0-1~ubuntu.22.04~jammy)
Used Package Manager
pnpm
Logs
Click to expand!
Validations
The text was updated successfully, but these errors were encountered: