Closed paldepind closed 3 years ago
If you are running something locally on port 8082 then this is probably conflicting with the debug server which is trying to run on the same port. You can try changing the port which is used. On iOS you would need to change the port used here: https://github.com/realm/realm-js/blob/master/react-native/ios/RealmReact/RealmReact.mm#L41
I'm fairly certain that 8081 is the default port. If you look at the React Native documentation that is port they mention: https://facebook.github.io/react-native/docs/debugging.html
Yes that is the port used for react-native. Realm also runs its own RPC server on 8082 to support chrome debugging. We need to do this because some of the features of our apis are not supported by the native module apis provided by react-native.
You can change the port locally for testing purposes - after you npm install realm you can simply change the port in the installed files and in theory that should work.
Ok. Thank you for the explanation. I was not aware that Realm used a port in addition to the one used by React Native. I'll see if I can get it to working.
But I guess it's not the intention to throw the "Module AppRegistry is not a registered callable module" error. It makes using the app with just normal Chrome debugging impossible.
I've tried
adb forward tcp:8082 tcp:8082
but it doesn't seems to work.
I'm not sure what the issue is. If you are able to share your project I could try to take a look. From searching online it seems like you could have an error unrelated to Realm in your index.js
file which might cause this issue but I'm not really sure. Also just want to make sure you know remote debugging currently only works when using the emulator/genymotion so if you are trying to run on device that could also be causing issues.
Were you able to make any progress with this? Does chrome debugging work for you on a newly generated react-native project which included Realm?
Sorry for the delay. I highly appreciate the your answers.
When I run the application on my device without remote JS debugging everything seems fine. But when I activate remote JS debugging I get the error I posted in OP.
If I run in an emulator I see exact same. However, after running adb forward tcp:8082 tcp:8082
everything does work in the emulator without errors. So it seems to me like Realm not being able to connect is what is causing the Module AppRegistry is not a registered callable module.
error.
I will try setting up Realm in a new react-native project and let you know how it turns out.
I've just setup a new react-native project by doing the following:
react-native init RealmReactTest
npm install --save realm
rnpm link realm
I then added the line
const Realm = require('realm');
To index.android.js
.
When running the project at that point I got the error: Missing Realm constructor - please ensure RealmReact framework is included
. I fixed that by following the instructions here.
I now experience exactly the same as what I described in my last post. No problems without debugging enabled and Module AppRegistry is not a registered callable module
when it is.
Just for reference: I'm testing on an Android device, I'm using Linux, rnpm is version 1.9.0, Realm is version 0.14.3 and React Native is 0.31.0.
@alazier Have you had any luck reproducing the issue from the steps I posted above?
@paldepind there is definitely something wrong - when following your steps the required lines are not added to MainApplication.java
by rnpm. Can you ensure that the protected List<ReactPackage> getPackages()
method returns new RealmReactPackage()
? If not adding this line along with import io.realm.react.RealmReactPackage;
should fix the issue. I will look into what is going wrong with rnpm.
Yes. As I mentioned I added the line manually by following the instructions here. So the rnpm problem was quite easily solved. What I'm reporting here happens unrelated to that issue I think.
Were you ever able to resolve this?
Hello @alazier. No, unfortunately not. Debugging on device is still impossible. Probably same issue as in #571. I'm hoping that maybe #598 will make it possible to at least make debugging possible.
Still no solution for this issue?
Same issue here.
Same here. 👍
i can debug on realm 1.31
But nothing else
I am able to do remote Chrome debug on an iOS device with 1.10.1
and React Native 0.45.1
but encounter this problem when the app is woken up through Bluetooth State Restoration, which makes it impossible to debug Bluetooth issues and unfortunately is a deal breaker for us.
Is there any plan on fixing this issue? Otherwise we will unfortunately have no other choice but to look for alternative database libraries.
@shanghongshen001 did you mean realm 1.3.1
? I'm on 1.11.0
and I still have this problem with Android (but not iOS).
@MrHubble I can run and debug on 1.3.1 . The update to 1.10.1 will not be done. I don't know why not. On windows10 , android ,rn 0.45.1
This still seems to be an issue. After about 30 seconds, I get a timeout error:
POST http://77.18.14.132:8083/create_session net::ERR_CONNECTION_TIMED_OUT
What's interesting is that the IP reported seems to be the public IP of my 4G connection instead of the wifi connection as is probably intended.
Edit: Oh, it looks like it's doing 4 attempts against the 4G connection IP and two against the IP of what I assume to be the phone. The first phone-request fails, but the second somehow succeeds. After that it seems to be working (until the next start)
Does this issue fixed? I am facing same problem
@brithbutter I don't think so. We had so many problems with Realm on React Native (this one, in particular, performance, etc) that we moved to react-native-sqlite-storage. We have been happy ever since.
same issue :(
same+1
the same problem
same issue here
same issue
We have reworked the Chrome debugger support, and I suggest an upgrade to v10.1.x.
I am closing the issue but it is still observe, please create a new issue.
When I include Realm in my project and use remote JS debugging I see the following error on the phone: "Module AppRegistry is not a registered callable module". And the Chrome log shows:
It seems odd that the errors mention port 8082 since my local dev server is running on port 8082.
This is likely related to #465. The last comment in that thread mentions that remote debugging may not work at all. If that is the case then it would be really helpful if that was mentioned somewhere in the documentation.