'How to connect expo go app through docker devcontainer
problem
cannot connect with my expo app to the expo simulation
setup
- set up a devcontainer with vscode's extension.
- login into my expo account
- successful build
- expo go and laptop in the same network
- has worked before with last linux pc
node -e 'console.log(os.networkInterfaces())'results:
{
lo: [
{
address: '127.0.0.1',
netmask: '255.0.0.0',
internal: true,
cidr: '127.0.0.1/8',
...
}
],
eth0: [
{
address: '172.17.0.3',
netmask: '255.255.0.0',
internal: false,
cidr: '172.17.0.3/16',
...
}
]
I tried
- setting REACT_NATIVE_PACKAGER_HOSTNAME to host's ip
- without it gives me a link from its eth0
- open mac's firewall to vscode and docker
- turn off mac's firewall
- switch to tunnel connection
- but this gives an error for another question later
- tried posting and currently waiting responses here while exercising my google-fu
my environment
mac os 12.3 (monterey)
docker 4.7.1
devcontainer from microsoft's nodejs (alpine with node)
expo cli version: v5.3.2
previous environment
ubuntu 21.04
docker ~4.7.1
devcontainer from microsoft's nodejs (alpine with node)
expo cli version: ~5.3.2
to reproduce
setup a devcontainer
"VARIANT": "14-bullseye""features": {"git": "latest","aws-cli": "latest","desktop-lite": "latest","python": "latest" }
npm i -g expo-cliexpo inita new sample projectexpo starttry to connect expo go via the qr
- no errors on expo-cli but go-app
java.net.ConnectException: Failed to connect to /192.x.x.x:19000
- no errors on expo-cli but go-app
if not working like me:
- close expo
export REACT_NATIVE_PACKAGER_HOSTNAME=192.168.1.xxxxxx is host's lan ip addressexpo start- try connecting with expo go app via qr
- no errors on expo-cli but go-app
java.net.ConnectException: Failed to connect to /192.x.x.x:19000
- no errors on expo-cli but go-app
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
