Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Expo network response timeout? Port issue

I am getting error on my expo go app.

Error :

Uncaught error:java.net.SocketTimeout Exception: failed to connect to /192.168.100.10(port 19000) from / 192.168.100.2(port 39440) after 10000ms.

enter image description here


1 Answers

Connecting Expo Go from device (android) and my react-native app (windows 10):

Some reasons I found:

  1. Different internet network
  2. IP address wrong (one possible reason: virtual machines)
  3. Firewall

Some facts:

  1. About change LAN connection to TUNNEL in Metro UI:
  • Metro bundler user interface is not displayed in browser (only a json) because it was released after [email protected]
  • Change type connection is not recommended. It is slower.
  • settings.json file in .expo folder has "hostType": "lan" attribute but it has not be changed manually. There is the documentation about "to enable tunneling" (when it is really necessary) https://docs.expo.dev/workflow/expo-cli/?redirected
  1. You could set your IP address as an enviroment variable and run npm start. CyrisXD explains here https://github.com/expo/create-react-native-app/issues/144

My solution:

  • Windows settings / To allow app (Node.js Javascript Runtime) to communicate through Windows firewall1 / Advanced security / Entry rules2.

  • Spanish: Configuración de Windows / Permitir a las aplicaciones comunicarse a través de Firewall de Windows Defender1 / Cambiar configuración / Reglas de entrada2.

like image 135
Zayra Velasco Avatar answered Sep 21 '25 13:09

Zayra Velasco