4

Running npm start or expo start launches the project as follows:

React  You can now view My React Native App in the browser.

  Local:            http://localhost:19006/   On Your Network:  http://157.201.29.49:19006/

Note that the development build is not optimized.

 › To create a production build, run expo build:web  › Press Ctrl+C to exit.

 Expo  Press ? to show a list of all available commands.

Launching the Expo web by pressing ‘w’ opens Chrome browser with the IP address URI http://157.201.29.49:19006/ as advised.

However because of the office VPN, Chrome browser fails to resolve the address. The error is:

This site can’t be reached
ERR_CONNECTION_TIMED_OUT

Replacing the URL in Chrome with http://localhost:19006 succeeds.

How can I start Expo such that pressing ‘w’ automatically launches with localhost rather than the IP address?

Max MacLeod
  • 26,115
  • 13
  • 104
  • 132

3 Answers3

5

To fix, launch expo directly as follows supplying the localhost option:

expo start —-localhost

See Expo CLI docs for expo start:

--localhost Same as --host localhost
Max MacLeod
  • 26,115
  • 13
  • 104
  • 132
5

It is no longer supported.

Update July 25, 2022: expo-cli@6.0.0 has been released with the web UI removed. The last release to include the web UI is expo-cli@5.5.1.

learn more

Vahid
  • 97
  • 1
  • 7
2
expo start --web

or

npm run web
Faraz
  • 45
  • 1
  • 7