reactotron: Reactotron not connecting

Hi,

I installed Reactotron tonight and it seemed to work well at first, I started installing plugins and playing with logging. It was all going great until all of a sudden it won’t connect.

No errors. just nothing…

I am using Expo, a real Android device using Expo’s tunneling, my lan IP is 192.168.0.22:19000

Here is my config

import url from "url"
import { NativeModules } from "react-native";
import Reactotron, { asyncStorage, openInEditor, networking, trackGlobalErrors } from 'reactotron-react-native'
import { reactotronRedux } from "reactotron-redux"
import apisaucePlugin from 'reactotron-apisauce'

const { hostname } = url.parse(NativeModules.SourceCode.scriptURL)

const reactotron = Reactotron
  .configure({host: hostname })
  .use(networking())
  .use(reactotronRedux())
  .use(asyncStorage())
  .use(openInEditor())
  .use(trackGlobalErrors())
  .use(apisaucePlugin({
    // ignoreContentTypes: /^(image)\/.*$/i   // <--- a way to skip printing the body of some requests (default is any image)
  }))
  .useReactNative()
  .connect()

  export default reactotron

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 3
  • Comments: 40 (4 by maintainers)

Commits related to this issue

Most upvoted comments

For me I had to put in my machines local IP to get it to connect

Reactotron
  .configure({ host: '192.168.0.148' })
  .useReactNative()
  .connect

For anyone having connectivity issues, remember that you’ll need to run adb reverse tcp:9090 tcp:9090 every time you reconnect your physical device or emulator. Most likely everyone above has already done this, but for any new users that come here looking for answers it might be helpful.

What does hostname resolve to? Hopefully 192.168.0.22. Just the IP address itself.

You can update that whole reactotron block to become:

const reactotron = Reactotron
  .configure({ host: hostname })
  .useReactNative()
  .use(reactotronRedux())

Notice how I removed the connect() call?

The reason is because there’s a timing issue where if you don’t have redux setup yet, the app will connect and ask for data from the store before redux comes to life.

For redux apps, it’s better to defer the Reactotron.connect() call to the componentDidMount function of the root component.

Give that a shot.

I got some trouble too with this. I’ve tried with IP, which didn’t work. After doing the adb reverse tcp:9090 tcp:9090 and removing the ‘host’ property from config() it works now. Thanks @kevinvangelder

@jon64digital I had a similar issue with the project that I am currently working on. Reactotron.app never received a connection from my application. No errors, no logs, no nothing. I tested it on a separate brand new app, following the minimal config as is explained in the RADME file. That worked fine. But there were no difference between both apps configs. So I check both package.json files.

What my non-working project had:

    "reactotron-react-native": "^1.14.0",
    "reactotron-redux": "^1.13.0", // because I keep the navigation state in my redux store, you might not have/need this.

What my new test working project had:

    "reactotron-react-native": "^2.1.0",
    "reactotron-redux": "^2.1.0",

So I installed those new versions of reactotron dependencies, build the app again and finally it was able to connect to Reactotron.app(v2.1.2 by the way).

Hope, it helps.

I know Expo and reactotron has had some connectivity issues. In your configure I would suggest adding your IP as the host to see if that makes it work. Something like this:

.configure({ host: '<YOUR IP>' })

Yes, apisauce plugin is not on there as it is not shipped with reactotron-react-native. That said the networking plugin supersedes the apisauce plugin as it listens to all network traffic in RN (at least in the RN side, not the native side)

Here my setup

Phone connected over wifi -> IP 192.168.0.4 MacbookPro (as server) connected over wifi -> IP 192.168.0.3 Reactotron run in macbook port 9090 React Native run on server port 9091

So first time we should reverse the adb port 9090 to 9091. Which is the reactotron on the phone is looking for port 9090 and the server run on port 9091.

Command step 1 adb reverse tcp:9090 tcp:9091

After it we want to connect our phone over wifi, so just run Command step 2 adb tcpip 5555 Command step 3 adb connect 192.168.0.4:5555

To run react native I recommend to use script in package.json

Command step 4 react-native run-android --port 9091

The last one check your reactotron configuration

Reactotron
.configure({
    host: '192.168.0.3',
    name: 'appname'
})
.useReactNative()
.connect();

And done reactotron connected. For troubleshooting make sure adb kill-server and run adb start-server again and check your firewall on your server.

This has been fixed in reactotron-react-native@5.0.4-beta.15, update your app to this package or above and remove host from your Reactotron.configure call if you have it set

Screenshot 2023-11-30 at 1 56 59 PM

In my case port 9090 is taken by another program and reactotron is not warning me about that. Switching to an unoccupied port fixes the problem.

adb reverse tcp:<port_reactotorn_listening> tcp:<port_reactotorn_listening>

Instead of manually putting in the IP address everytime. It’s better if you run the following command if it doesn’t connect while on device. adb reverse tcp:9090 tcp:9090

I’m using a real ios device for developing. Also I use expo. https://expo.io.

I use connection over lan.

I use version "reactotron-react-native": "^3.2.2". Reactotron is on version 2.11.2-beta.1 I have tried Reactotron.configure({lan: 'exp://192.168.0.241:19000'}).useReactNative() with various parameters. .connect() is called in componentDidMount

How can I do the adb reverse tcp:9090 tcp:9090 thing. In the command line? I get: error: no devices/emulators found

For me, I was using "reactotron-react-native": "^1.14.0" but my Reactotron version was 2.6.0

I upgraded "reactotron-react-native": "^2.6.0" but that still didn’t work for me. So downgraded it back to 1.14.0 and did the same to Reactotron and it finally worked.