Abdul Basit Mangat
Abdul Basit Mangat

Reputation: 1180

Could not connect to the development server react native ios simulator Node

Could not connect to development server:

Ensure the following

  • Node server is running & available on the same network -run npm start from react native root.

  • Node server URL is correctly setup in app delegate

  • wifi is enabled & connected to same network as node server

React Native version: "react-native": "0.61.5", "node": "10.14.1"

Steps To Reproduce

  1. Running app using Xcode & using iphone X simulator
  2. Not testing the app on any physical device
  3. Changed the ports as well for the specific project.
  4. But metro bundler not working

Expected Results

Metro bundler should connect and app should run

enter image description here

Upvotes: 2

Views: 3554

Answers (3)

user19788526
user19788526

Reputation: 11

This is an old question, so I hope you've resolved it, but if not or for future readers, I found a solution in this GH thread https://github.com/facebook/react-native/issues/29587

I uninstalled watchman with brew uninstall watchman (and did not reinstall it) and my iOS app was able to connect! Tried several solutions and this is the only one that worked for me.

Upvotes: 1

Giannis Prokopos
Giannis Prokopos

Reputation: 1

I had the same issue, tried a lot but the solution is really simple. Just hit the 'i' key from the terminal and the connection occurs just fine.

As seen here:

Upvotes: -1

Abdul Basit Mangat
Abdul Basit Mangat

Reputation: 1180

I tried multiple solutions for the above issue.

  1. rm -rf node_modules/ && rm -rf yarn_lock/ && yarn install && cd ios && pod install
  2. checking out the specific process & cancel thatthread/process by specifying the p_id nmp
  3. audit --fix

None of the above solution worked for me except this command enter image description here

After all you have to do yarn add react-native-gesture-handler react-native-reanimated react-native-screens

Close bundler & shift +cmd + k on xcode and run the app by cmd + R

Upvotes: 0

Related Questions