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

Doesn't work with realm #29

Open
IamRoman opened this issue May 11, 2018 · 9 comments
Open

Doesn't work with realm #29

IamRoman opened this issue May 11, 2018 · 9 comments

Comments

@IamRoman
Copy link

Hi!
I'm trying a project with realm but I catch error "com.facebook.react.JavaScript (15): EXC_BAD_ACCESS (code=1, address=0x0)" after (Cmd + R), testing also did on android (real devices), it works without errors, but it does not start another thread.

2018-05-11 14 46 13

Thanks!

@Traviskn
Copy link
Contributor

Traviskn commented Jun 2, 2018

Hi @IamRoman, I have no experience using Realm so unfortunately I am not sure what we could do to resolve this issue. I do not think this error is caused by react-native-threads but is probably an error with Realm

@joaom182
Copy link
Contributor

Same issue here

@gitTeub
Copy link

gitTeub commented Oct 12, 2018

Hi! Did anybody find a solution or workaround?

@zabojad
Copy link

zabojad commented Nov 14, 2018

Hi there !
You are not alone using Realm and this package at the same time.
For now, my project is targetting only Android and I have not crossed yet any problem on Android.
We will soon target iOS so I guess we will have the same issue.
I'll tell here if we find a solution...

@zabojad
Copy link

zabojad commented Nov 15, 2018

OK, actually, it is not working with Android neither.

As soon as we start a new thread, Realm gets closed. I've created an issue about it there: realm/realm-js#2117

@z98361
Copy link

z98361 commented Nov 24, 2018

any update? pls

@nickymagic
Copy link

Hi,
I found a workaround that makes these two libraries work together.
Firstly, starting of new thread for some reason kills realm, so I reinitialized realm whenever I used it.
Rather then exporting realm instance and using it in every file I just exported schema and reinitialized realm there.
It looks something like this
const realm = new Realm({ schema : schemas });
I initialized this variable before using any realm operation and it worked without crashing

@tastyqbit
Copy link

Unfortunately this is still an issue. Any ideas for even a hacky fix?

@SMhdAsadi
Copy link

SMhdAsadi commented May 19, 2022

I can use both of these libraries in my project.
All you need to do is to use Realm in only one thread. For example I only use Realm in the worker thread so that my main thread doesn't know there is Realm, but you can communicate with postMessage and onmessage methods.
Hope it helps.

[Edit] It works on Android, but in my test on iOS, it failes to bundle the thread. Loading stucks at 100%.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants