create-react-native-app: Timeout When Running `npm start`

Description

If I run npm start and then scan the qr code in the expo app, I always get a timeout error.

My phone and my laptop are on the same network.

Expected Behavior

  • create a new project with create-react-native-app
  • run npm start
  • scan shown qr code
  • expo app does not timeout.

Observed Behavior

  • expo app does timeout:
"Error while loading: The request timed out." (code -1001)

Environment

Please run these commands in the project folder and fill in their results:

  • npm ls react-native-scripts: react-native-scripts@0.0.27
  • npm ls react-native: react-native@0.42.3
  • npm ls expo: expo@15.1.3
  • node -v: v6.9.5
  • npm -v: 3.10.10
  • yarn --version: not installed
  • watchman version: “version”: “4.7.0”

Also specify:

  1. Operating system: NixOS 17.09
  2. Phone/emulator/simulator & version: iPhone 5s // iOS 10.2.1

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 2
  • Comments: 28 (5 by maintainers)

Most upvoted comments

In my case, i solved this problem by changing default IP of CRNA to IP of my Windows PC . 192.168.56.1:19000 (default) to my pc IP.

https://github.com/react-community/create-react-native-app/blob/master/react-native-scripts/template/README.md#configuring-packager-ip-address

The problem is your OS firewall block access from your phone. Find your phone ip address in settings and allow on your PC/Laptop access (through firewall configuration) from phone ip to your PC ip address and ports 19000, 19001. On ubuntu with ufw firewall need to do something like: sudo ufw allow from phone.ip.address.here to pc.ip.address.here port 19001

I fixed this problem removing all my networks. In mi case I am connected by wifi, but Create-React-Native was selecting my Ethernet network, so, I’ve disabled from Windows Settings, and now its working

Thanks @Onumis I eventually got it