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
- chore(deps): update typescript-eslint monorepo to v4.23.0 (#815) Co-authored-by: Renovate Bot <bot@renovateapp.com> — committed to infinitered/reactotron by renovate[bot] 3 years ago
- chore(deps): update typescript-eslint monorepo to v4.32.0 (#815) Co-authored-by: Renovate Bot <bot@renovateapp.com> — committed to infinitered/reactotron by renovate[bot] 3 years ago
- fix(reactotron-react-native): remove rn-host-detect, use pure snippet Fixes #1305, #1107, #815 — committed to infinitered/reactotron by joshuayoes 9 months ago
- fix(reactotron-react-native): remove rn-host-detect, use embedded snippet (#1311) There are several issues where users had trouble connecting to reactotron #1305, #1107, #815 This PR fixes them b... — committed to infinitered/reactotron by joshuayoes 9 months ago
For me I had to put in my machines local IP to get it to connect
For anyone having connectivity issues, remember that you’ll need to run
adb reverse tcp:9090 tcp:9090every 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
hostnameresolve to? Hopefully192.168.0.22. Just the IP address itself.You can update that whole reactotron block to become:
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 thecomponentDidMountfunction 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:9090and 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:
What my new test working project had:
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,
apisauceplugin is not on there as it is not shipped withreactotron-react-native. That said thenetworkingplugin supersedes theapisauceplugin 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:9091After it we want to connect our phone over wifi, so just run Command step 2
adb tcpip 5555Command step 3adb connect 192.168.0.4:5555To run react native I recommend to use script in package.json
Command step 4
react-native run-android --port 9091The last one check your reactotron configuration
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 removehostfrom your Reactotron.configure call if you have it setIn 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:9090I’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 version2.11.2-beta.1I have triedReactotron.configure({lan: 'exp://192.168.0.241:19000'}).useReactNative()with various parameters..connect()is called incomponentDidMountHow can I do the
adb reverse tcp:9090 tcp:9090thing. In the command line? I get:error: no devices/emulators foundFor me, I was using
"reactotron-react-native": "^1.14.0"but my Reactotron version was2.6.0I upgraded
"reactotron-react-native": "^2.6.0"but that still didn’t work for me. So downgraded it back to1.14.0and did the same to Reactotron and it finally worked.