Skip to content

Dev Containers with VS Code Remote on Windows do not support IPv6 loopback #10769

@GingerGeek

Description

@GingerGeek

Have you read the Contributing Guidelines on issues?

Prerequisites

  • I'm using the latest version of Docusaurus.
  • I have tried the npm run clear or yarn clear command.
  • I have tried rm -rf node_modules yarn.lock package-lock.json and re-installing packages.
  • I have tried creating a repro with https://new.docusaurus.io.
  • I have read the console error message carefully (if applicable).

Description

Dev Containers do not work out of box on Windows since Docker 26.

When Docusaurus is started via start or serve then the dev server will bind to an IPv6 loopback by default when listening to localhost.

VS Code remote does not support forwarding IPv6

Reproducible demo

No response

Steps to reproduce

  1. Clone the docusaurus repository or use a dev container configuration for a repo that uses Docusaurus (e.g. okd-project/okd-web)
  2. On a Windows machine running Docker 26+, open the project in dev container
  3. Run either docusaurus start or docusaurus serve
  4. Note how although port is reported as forwarded (3000) and the browser opens, it fails to connect and the browser times out

Expected behavior

The dev container works out of box with port forwarding

Actual behavior

The internal webpack dev server is binding only to an IPv6 loopback address.

This is due to a change in Docker Desktop introduced in v26 moby/moby#47062

Other projects have also been affected by this e.g. vitejs/vite#16522

An issue in VS Code remote has been open for some time for a resolution microsoft/vscode-remote-release#7029

Current workarounds in ViteJS include recommendations to alter Devcontianer to disable IPv6 or to manually set the address of the dev server to a V4 address (ie 127.0.0.1)

Your environment

  • Public source code: N/A (although present on okd-project/okd-web and this repo!)
  • Public site URL: N/A
  • Docusaurus version used: latest
  • Environment name and version (e.g. Chrome 89, Node.js 16.4):
  • Operating system and version (e.g. Ubuntu 20.04.2 LTS):
WSL version: 2.3.22.0
Kernel version: 5.15.153.1-2
WSLg version: 1.0.65
MSRDC version: 1.2.5620
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26100.1-240331-1435.ge-release
Windows version: 10.0.22635.4580
C:\Users\Zed> docker --version
Docker version 27.4.0, build bde2b89
C:\Users\Zed>

Self-service

  • I'd be willing to fix this bug myself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAn error in the Docusaurus core causing instability or issues with its executionhelp wantedAsking for outside help and/or contributions to this particular issue or PR.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions