Preview URL doesn't work (exp://localhost:19000)

The first time I created an app within the Expo XDE I got a long preview URL (for the Expo app) which ended in direct:80, but now I keep getting ‘exp://localhost:19000’ as my URL which isn’t accepted by the app. I’ve tried restarting my PC and deleting and recreating the Android emulation but nothing seems to fix this. Any help would be incredibly appreciated as I have no way of previewing my app!

If it’s not clear what I mean here is a screenshot of the URL I’m talking about: https://cdn.pbrd.co/images/GzhMAAv.png

Thanks in advance!

2 Likes

My best guess is that you have to change your settings to use localhost. You can change that by clicking the gear next to the URL and then choosing Host > Tunnel. Let me know if that doesn’t work and I’ll try to work with you through another solution.

1 Like

Thanks for the reply. Unfortunately setting it to localhost doesn’t fix the issue – I still get “Something went wrong. // Could not load exp://localhost:19000.” The specific error in the error log is: “Uncaught Error: java.net.ConnectException: Failed to connect to localhost/127.0.0.1:19000”

1 Like

I’m tracking this issue for you: could not load exp://ipaddres+port · Issue #81 · expo/create-react-native-app · GitHub to help you figure out the solution.

  • Do you have windows firewall enabled? Could that be the culprit?

The error persists even with Windows Firewall completely disabled. I find it strange that the URL is exp://localhost:19000 because before it was a much longer URL (ending with direct:80, IIRC) which worked absolutely fine.

2 Likes

Same issues here changing from tunnel to localhost or adjusting most of the other settings have no impact

1 Like

I have a few ideas of what could help:

If you are behind a VPN, try disabling the VPN.

If you are using windows 10, run CMD on your machine and type ipconfig. Take a look at the first Ethernet Adapter. If it doesn’t say Ethernet Adapter Ethernet it means Expo is taking the IP address of something else.

To fix this, go to network connections and disable the adapter that it should not be pointing at.

Connect your computer to the network and your phone to the same network. Restart Expo.

Please let me know if this doesn’t work.

2 Likes

Hi @jimmylee, thanks for the help. The first network listed with ipconfig is ‘Ethernet adapter VirtualBox Host-Only Network’ – I think if I was to disable this, my Android emulator (genymotion) would stop working as it depends on VirtualBox’s networking, doesn’t it?

I’ll give it a go anyway and report back if it’s successful.

Okay, as I suspected, Genymotion no longer works with this disabled and it requests for the adapter(s) to be re-enabled. However, if I start Expo before re-enabling them, everything works as expected. So this works well as a temporary fix.

1 Like

I’m glad at least something works, we’ll need to figure out a better solution here.

Has been a solution? Cause i am going through the same situation as well since last week…

1 Like

@ombu hey there!

In order to help you out better, you have to provide more details about the operating system and project you’re working on.

Thank you man… It Worked:smiling_face_with_three_hearts:

Hello. Can you elaborate more on the process. I am finding difficulties setting your solution.

This worked for me : http://exp://192.168.1.19:19000