Skip to content

Commit 0f9ec05

Browse files
authored
Merge pull request #375 from SAFE-Stack/devcontainers-troubleshooting
Dev Container IPv6 workaround
2 parents 6b1abf3 + eaf2919 commit 0f9ec05

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

docs/faq/faq-troubleshooting.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,24 @@ For more info, see this [issue](https://github.com/SAFE-Stack/SAFE-template/issu
5757
### Server port change
5858

5959
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.
60+
61+
### Cannot connect to the Client app when running in a VS Code Dev Container
62+
63+
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.
64+
65+
Until Microsoft resolve that issue there are 2 ways to work around it:
66+
67+
1. **Disable IPv6 in the Dev Container** by adding a runArgs setting in `.devcontainer/devcontainer.json`:
68+
69+
```diff
70+
"image": "mcr.microsoft.com/devcontainers/dotnet:1-8.0-bookworm",
71+
+ "runArgs": [ "--sysctl", "net.ipv6.conf.all.disable_ipv6=1"],
72+
```
73+
74+
2. Alternatively, **force the Client app to use IPv4 only** by specifying hostname in the Vite config `src/Client/vite.config.mts`:
75+
76+
```diff
77+
server: {
78+
port: 8080,
79+
+ host: "127.0.0.1",
80+
```

0 commit comments

Comments
 (0)