Forrest
Forrest

Reputation: 93

Error while loading: a server with specified hostname could not be found

So I have been struggling with a weird issue with my expo setup for about the last month or so. I created my project through Expo and when I use exp start in the terminal or try to load the project through Expo XDE, it hangs after dependency graph loaded. I thought it was an NPM issue (and worked on my coding environment for weeks trying to fix it) but then I created a new project using create-react-native-app and noticed there seems to be an issue with the connection with the simulator. When I instantiate a new project with create-react-native-app (not expo) I get this error exp://localhost:19000 — Error while loading: a server with specified hostname could not be found. (code - 1003) Here is a photo of what it looks like:

exp error while loading

Then I tried to put the address of the project from the terminal into the simulator:

pasting link from terminal

And it actually works! The app loads!

app loads successfully

This is making me think there is a problem with the simulator's connection. Perhaps it is pointed to the wrong port? Using this method, I can run apps that were made from create-react-native-app but not my original projected I created through expo because that still gets hung and won’t launch the simulator. Projects created through Expo don't have an iOS file which is how you launch a create-react-native-app project (yarn run ios).

Any ideas about how I could go about fixing this?

Upvotes: 1

Views: 2389

Answers (1)

Mark Miller
Mark Miller

Reputation: 309

Try uninstalling both Xcode & Expo.

Seems like the ports for the simulator are on different references of some kind.

Make sure that all of x-code, simulators, and expo local version are up to date before you launch the simulator after reinstalling Xcode & Expo.

Upvotes: 2

Related Questions