Skip to content

Dev Container IPv6 workaround #375

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions docs/faq/faq-troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,24 @@ For more info, see this [issue](https://github.com/SAFE-Stack/SAFE-template/issu
### Server port change

The port that the server runs on changed from 8085 to 5000 (the ASP.NET Core default) in v4 of the SAFE Template. This was to make it compatible with deployment to Azure App Service on Linux.

### Cannot connect to the Client app when running in a VS Code Dev Container

There is an [open issue](https://github.com/microsoft/vscode-remote-release/issues/7029) for VS Code not forwarding ports for services using IPv6 inside a Dev Container. Node uses IPv6 if it's available, so out of the box we cannot connect to the client.

Until Microsoft resolve that issue there are 2 ways to work around it:

1. **Disable IPv6 in the Dev Container** by adding a runArgs setting in `.devcontainer/devcontainer.json`:

```diff
"image": "mcr.microsoft.com/devcontainers/dotnet:1-8.0-bookworm",
+ "runArgs": [ "--sysctl", "net.ipv6.conf.all.disable_ipv6=1"],
```

2. Alternatively, **force the Client app to use IPv4 only** by specifying hostname in the Vite config `src/Client/vite.config.mts`:

```diff
server: {
port: 8080,
+ host: "127.0.0.1",
```