Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chrome debugging fails in RN using Realm #505

Closed
maikokuppe opened this issue Jun 24, 2016 · 17 comments
Closed

Chrome debugging fails in RN using Realm #505

maikokuppe opened this issue Jun 24, 2016 · 17 comments

Comments

@maikokuppe
Copy link

maikokuppe commented Jun 24, 2016

When enabling Chrome Debugging in the React Native app running on a real device, the Chrome Debugging Tab opens and after some seconds, this error appears
debugerror
The app keeps running on the device.
When trying to reload the app, it loads forever (the indicator keeps spinning):
debugerror2
Unlike #491 there are no get_property requests listed in dev tools:
debugerror3

These errors began when I started to use Realm in my app. Everything works fine except for Chrome Debugging.

@appden
Copy link
Contributor

appden commented Jun 29, 2016

This really looks to me like an issue you're having with React Native, not Realm. Were you able to get this working?

@maikokuppe
Copy link
Author

Nope. I've not been using the chrome debugger since then.

@appden
Copy link
Contributor

appden commented Jun 30, 2016

I believe I've ran into this before, but I'm still pretty sure it's not caused by Realm. I would try restarting closing the Chrome debugging tab, restarting the packager, and restarting the app.

@maikokuppe
Copy link
Author

maikokuppe commented Jun 30, 2016

I restarted everything possible:

  • Chrome debugging tab
  • packager (run npm start again)
  • app
  • deleted the app entirely and run react-native run-android again
  • device

Nothing works.

@alazier
Copy link
Contributor

alazier commented Jun 30, 2016

Would it be possible for you to share your app or an example app that reproduces the issue? You can send it to us privately at help@realm.io

@maikokuppe
Copy link
Author

I just tried to reproduce it. The steps were pretty simple, so I don't think you really need a whole example app, but let me know if you do:

react-native init example
cd example
npm install --save realm
# make sure, rnpm is installed (`sudo npm install -g rnpm` should do it)
rnpm link realm
react-native run-android
npm start
# Chrome debugging works now

If I add the line import Realm from 'realm'; at the beginning of index.android.js, and reload the app, Chrome debugging stops working as mentioned in my first comment.

The device has Android 5.0.2 and my example had these versions:

"dependencies": {
  "react": "15.1.0",
  "react-native": "0.28.0",
  "realm": "^0.14.1"
}

@alazier
Copy link
Contributor

alazier commented Jul 1, 2016

I could be that port forwarding isn't working. This is supposed to happen automatically but could happen if you have multiple devices. Can you try running these commands to see if they make a difference?

adb reverse tcp:8081 tcp:8081
adb forward tcp:8082 tcp:8082

@maikokuppe
Copy link
Author

Weird news: This building's internet connection is broken, so I had to connect through an iPad hotspot. Now the debugger works both in the example app and in my original app.

I'm going to investigate this further, when my internet connection is repaired (within the next 24h), but it seems to be an issue with my wlan infrastructure.

I'm going to try your reverse/forward commands, too.

@maikokuppe
Copy link
Author

Now, back in my home wlan, I get the same error as before. I tried your reverse/forward commands, too, but nothing changed.

I have no clue what's causing this. There's nothing custom in my wlan configuration.

@alazier
Copy link
Contributor

alazier commented Jul 5, 2016

I'm not convinced this issue is being caused by Realm. Do you have the same issues with projects not using Realm?

@maikokuppe
Copy link
Author

No. The only time, this happens, is when I import realm in a file. See my reproduction steps. That was a clean simple reproduction. Before importing realm, the Chrome Debugger worked, but after importing it didn't work anymore.

But as I said before, it works with an iPad hotspot (both the reproduction app and my original app) but not with my home wlan (with default settings). Let's use some high level logic here:

  • The functioning of the Chrome debugger does depend on the usage of realm, but only when using my home wlan.
  • The functioning of the Chrome debugger does depend on the wlan environment, but only when using realm.
  • The functioning of the Chrome debugger does not depend on specific app details.

Based on this reasoning it seems that realm or my home wlan must be the cause of the issue. Having checked that I'm using default settings in my home wlan, and not having any unusual wlan problems in the last years, my bet is on realm.

Would it make a difference for you if I'd reset my router setting to firmware config? I mean, if that was enough "proof" for you to investigate this, I'd do it, but if it wouldn't change your "investigation motivation", I'll skip that ;)

@alazier
Copy link
Contributor

alazier commented Jul 8, 2016

Don't think resetting the firmware will make much of a difference. The realm debug server runs on the device on port 8082 so if this were for some reason being blocked on your configuration that might explain things? I would like to resolve this but have not yet been able to reproduce the issue. Do you have the same issue when running with genymotion or using android emulator rather than running on device?

@maikokuppe
Copy link
Author

I tried it with an android emulator. I had to run adb forward tcp:8082 tcp:8082 to make the Chrome debugger work. So no, no issue there... Would it help if I tried it with genymotion, too?

@alazier
Copy link
Contributor

alazier commented Jul 17, 2016

I think we simply have issues with chrome debug mode when running on device. Hopefully you can debug your app using the emulator/genymotion until we are able to properly support this. In my experience genymotion is much faster/a better dev experience.

@alazier alazier changed the title Chrome debugging fails in RN using Realm Chrome debugging fails in RN using Realm on device Jul 17, 2016
@alazier alazier changed the title Chrome debugging fails in RN using Realm on device Chrome debugging fails in RN using Realm Jul 17, 2016
@hayait599
Copy link

same issue
2017

@lattice0
Copy link

lattice0 commented Apr 3, 2018

this might help
#1732 (comment)

@kneth
Copy link
Contributor

kneth commented Dec 15, 2020

I am closing the issue as we have in v10.x made many changes to our Chrome debugger support.

@sync-by-unito sync-by-unito bot closed this as completed Dec 15, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

9 participants