-
Notifications
You must be signed in to change notification settings - Fork 313
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
[Windows+WSL2+Docker] Impossible to reach forwarded port from DevContainer #9893
Comments
UPDATE: UPDATE 2: |
I am currently developing a web application using Vite and DevContainer. A few days ago, I encountered an issue where I could not access the application from the browser anymore despite having port forwarding set up for port 3000 as usual. This had been functioning as expected for several months until, possibly, the most recent automatic update of VSCode. As pointed out by @andreujuanc, the --host option when running Vite allows me to access the application. However, this should be considered a workaround, and the underlying issue still needs to be resolved. The following is an error displayed in the Server output when attempting to access localhost:3000 from the web browser: |
The same issue happened to me, and it was worked around by setting the |
Brilliant!! Thanks for letting me know. I'll keep this issue open since it's not a vite problem but it looks like a DNS issue when the latest version of docker resolves with ipv6 instead o v4. Maybe the remote extensions can do something about it not to add the host param or disabling ipv6 on all docker projects. |
Yes, indeed, the comment at vitejs/vite#16522 (comment) is quite insightful :) |
is a similar issue. FWIW, I solved this (on Windows) by downgrading from Docker 4.30.0 to 4.29.0 using the 4.29.0 installer
|
@alexr00 This works for me with a simple HTTP server listening on Could someone seeing this run |
Hi @chrmarti , sure here it is. First with the host:true set, and then the default. I can see there is one difference with the http:alt thing BTW, I just got a friend to do this without devcontainers natively on linux, and when he updated to the latest docker >= 23.1.0 it reproduced the issue. So this is most likely an network incompatibility issue between docker and vite, and the remote extensions just got tangled in. But I can still be wrong. |
I can reproduce with vite and the latest Docker Desktop for Mac. It seems |
Steps to Reproduce:
In the DevContainer
![image](https://private-user-images.githubusercontent.com/360052/331519827-cbd3d834-bf7c-48c9-9380-bd714b7cac3d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3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4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0yODkwYTgxMjA4NTY3ODhhZWYxNzZhZDAwYzRjZmJkYTYwYWVmNDU5YjliNTk0NWY0NWZmOTg0YjZmM2U2OWU1JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.2O5QztCDsIAG0G4EHhHUjGTM3xpqMnS7wlj9UWpb108)
I have tried:
This started two days ago, and I haven't installed or updated anything on my system.
I know this might be a problem with my box, but since this team is very knowledgeable about networking+extensions+wsl+docker I guessed that maybe it's something that can happen to more people and leaving trace of a way to fix it would be the best thing to do.
Would appreciate any help regarding this matter.
The text was updated successfully, but these errors were encountered: