question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Could not connect to development server

See original GitHub issue

Hello there, i can’t understand why the MetroBundler it’s not working.

Description

As soon as i start the app, it throws me this error that won’t let me connect to my metro bundler. I checked everything, from the port 8081 status and i don’t understand why. Via the simulator it’s working, but with my real device it’s not. I have an iPhone XR with iOS 13.6

React Native version:

System:
    OS: macOS 10.15.5
    CPU: (4) x64 Intel(R) Core(TM) i5-4258U CPU @ 2.40GHz
    Memory: 442.25 MB / 8.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 10.20.1 - /usr/local/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 6.14.7 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 13.6, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
    Android SDK:
      API Levels: 28, 29, 30
      Build Tools: 27.0.3, 28.0.3, 29.0.2, 29.0.3, 30.0.0, 30.0.1
      System Images: android-29 | Intel x86 Atom_64, android-29 | Google APIs Intel x86 Atom, android-30 | Google APIs Intel x86 Atom
      Android NDK: Not Found
  IDEs:
    Android Studio: 4.0 AI-193.6911.18.40.6626763
    Xcode: 11.6/11E708 - /usr/bin/xcodebuild
  Languages:
    Python: 2.7.16 - /usr/bin/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.11.0 => 16.11.0 
    react-native: 0.62.0 => 0.62.0 
  npmGlobalPackages:
    *react-native*: Not Found

Steps To Reproduce

I tried this steps

  1. yarn start --reset-cache
  2. yarn start
  3. cd ios && pod cache clean --all && pod deintegrate && rm Podfile.lock && pod install
  4. rebuild from Xcode and clean the build folder
  5. rm -rf node_modules and yarn to install the packages again

Expected Results

The app should connect to the MetroBundler.

Screenshot:

IMG_7820

The ip you see in the image is the right one.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:24 (1 by maintainers)

github_iconTop GitHub Comments

15reactions
scgrossmancommented, Jul 26, 2021

There seems to be a problem with watchman, removing it I was able to connect.

I did brew uninstall watchman and it resolved the issue, thanks @marcosdourado . I’m not quite sure why or how it resolved it. A mystery for another day.

14reactions
timbielawskicommented, Sep 22, 2020

I was having similar issues, thought it must be cached versions so cleared everything

  • rm -rf node_modules
  • rm -rf $TMPDIR/metro-* && rm -rf $TMPDIR/react-* && rm -rf $TMPDIR/haste-*
  • watchman watch-del-all
  • npm install
  • npm start – --reset-cache

It works!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Could not connect to React Native development server on ...
Open the in-app Developer menu. shake your phone or press CMD/ctrl + M · Click on Settings · click on Debug server host...
Read more >
Could not connect to development server : ReactNative
Could not connect to development server : ReactNative · Connection of multiple devices: Enter adb devices command your terminal to a check the...
Read more >
react-native root error - could not connect to development server
Experts, I was trying to use the native mobile quick start app. First I ran into the build errors, but after doing a...
Read more >
Could not connect to development server on android emulator ...
Could not connect to development server on android emulator and on real device. Have the same problem only on real android device. Solution:....
Read more >
Unable to load script/could not connect to dev server - Android ...
Please note that the Metro Bundler is in fact running on port 8081. (Opening http://127.0.0.1:8081/ with a browser (or curl) gives me: React ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found