Afik Menashe
Afik Menashe

Reputation: 97

Expo- Could not connect to the server

i trying to open a new project in my iphone , and it shows this message:enter image description here

NOTE: the connection is LAN , on TUNNEL mode it works fine but slow

Upvotes: 4

Views: 19471

Answers (4)

Ali Yar Khan
Ali Yar Khan

Reputation: 1344

I was facing issue because my VPN was running on my Android device. Switching it off worked for me

Upvotes: 0

Zezinho
Zezinho

Reputation: 21

  1. Open Start > Control Panel > System
  2. Go to Advanced System Settings > Environment Variables
  3. Set a System Environment Variable with the following name/value pair:
  4. name: REACT_NATIVE_PACKAGER_HOSTNAME
  5. value: < the IPv4 address you want to use > (if any address does not work, enter the current address IPV4 you are using)

That’s it!

IMPORTANT: remember to close and re-open the elevated PowerShell command prompt, since newly added Environment Variables wont’ be available on the existing prompts.

Upvotes: 2

brentvatne
brentvatne

Reputation: 8038

  • Change to LAN connection type in expo-cli
  • Open it again from your phone
  • If you get a similar error but with your LAN IP, your network does not allow connections between devices on the network, and you need to use tunnel or use simulator with localhost.

Upvotes: -2

Yonggan
Yonggan

Reputation: 140

You tried to connect to the wrong IP. the 127.0.0.1 is a localhost IP. You have to change to the IP where your Metro Builder Server runs on.

Maybe this Thread helps you to change to the correct IP: React Native Expo change default LAN IP

Upvotes: 2

Related Questions