-
Notifications
You must be signed in to change notification settings - Fork 586
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
RealmJS doesn't work with Electron > 10.4.0 #3650
Comments
➤ Alex Bevilacqua commented: Opening this, which is a duplicate now for visibility (not sure if this is the right process). |
Downgrading Electron hasn't helped, same crash. Seems like connected with 10.2.0 RealmJS
|
For what it's worth, Realm Studio is using Realm JS v10.1.3 with Electron v11.2.1. |
I tried that versions and it's still failing. It works only after disabling Sync, so seems like the issue is there. I will now try to remove some parts of Sync code to see if I can make it work, it may be that clientResetError handling or something else is breaking that. |
Tried downgrading Electron and RealmJS but it all constantly crashes when Sync is starting, no matter which versions combinations I've tried. Realm Studio doesn't use Sync as far as I can tell, which would explain why it works. |
Out findings:
All tested on Realm 10.2.0. We have tried both building on ARM64 M1 processor and X86 Intel processor (just in case something deep in the kernel was broken). It crashes no matter what machine is used to build it. Basically, MongoDB Realm Sync crashes any Electron app >= 11. We have also tried terminating the Sync and enabling it again in case the issue was related to specific user, but this did not change anything. It crashed on freshly setup Sync. Trying oldest RealmJS that works with MongoDB crashes as well with Electron 11.x This issue blocks usage of Realm Sync with Electron newer than 10.x. Workaround for now that works for us:
|
Glad to see that I did not hallucinate this issue. If it can help debug the problem, for us Realm Sync started to work again after stopping Sync from the MongoDB dashboard and re-enabling it. If I remember correctly, this operation triggers a reset on all clients, so only use it while testing! In the end, we decided not to use Realm Sync so I cannot tell whether this solution was final. |
➤ Ian Ward commented: [~kenneth.geisshirt] [~brian.munkholm] Can the support czar look at this please? Does this need core help? |
➤ Kenneth Geisshirt commented: The non-Windows - or support for M1 Macs - can be fixed by upgrading to v10.4.1. I have a simple Electron app on Windows 10 (64 bit, virtual machine) |----|----|----| I do observe "Received fatal exception 0xc06d007f" but a different error (the exception might not propagate in my app). |
The comment yesterday didn't come out as nicely as it should. We have continued the investigation, and our small Electron app cannot load with Realm JS v10.3.0-rc.1, v10.3.0, 10.4.0 and 10.4.1 (tested both Electron v10.4.6 and Electron v12.0.8). The test app is able to load using 10.2.0 (both Electron v10.4.6 and Electron v12.0.8) and it is able to sync. In v10.3.0-rc.1 we introduced a new build system, and we need to investigate why it produces a binary which doesn't work with Electron on Windows. @bartoszhernas @marcoancona @bimusiek I understand you have observed the crash using Realm JS v10.2.0 but please verify that |
➤ Kræn Hansen commented: Just reproduced a crash (still havn't extracted the backtrace) when initiating a sync connection using Realm JS 10.4.1 (and 10.2.0) and Electron 13.0.1 (and 12.0.9). The crash happens both in a main and renderer process. An interesting observation is that if the Realm was opened using Node.js first and Electron then reuses the database file on disk, the crash doesn't happen. I managed to extract a core dump from the crash: [^bf6ea9eb-60da-439a-b9e1-ec7d98833705.dmp] We'll have to continue the investigations by attaching a debugger and extracting more information. |
I can verify that I'm experiencing the same crash with our library when built from our latest |
Realm JavaScript v10.4.2 has a fix for Electon/Windows. |
@kneth Please take a look at realm/realm-studio#1430 |
@kneth @kraenhansen I can see that realm-studio got the patch somehow. However, when I try to build the app with Realm 10.5.0 I am still getting the error
Can we get this issue re-open please until the fix is provided? |
@bimusiek thanks for pinging us here. I agree, we should reopen and fix this issue. The temporary fix we needed in Realm Studio was this line:
My investigations this far concludes: Electron Builder (the We could add the empty file to our package, but since that feels a bit like a workaround, I would love to learn of alternative ways to tell electron-builder to consider Realm JS as having native modules which needs to be fetched when packaging up the app. |
@kraenhansen Weird, I have added I am building with Apple M1, maybe that is the issue or maybe we are excluding too many dirs from the final package? I will investigate it more, but I am not so experienced with native packages for Electron though. |
Ok, so I took a look at the |
Another node package that was for react-native somehow got bundled into our asar and it was creating the same issue. The fix from @kraenhansen works as expected.
Thank you very much, we can finally update our windows app with newest Realm <3 |
I've created another issue with a more precise description: #3828 - please go watch that for updates. |
@kraenhansen, Just wanted to know if the issue is resolved or not? |
@abhishekmatta999 Hey, we can confirm that Realm works great on both Windows, OSX (also native M1) and Linux. As long as you use workaround from https://github.com/realm/realm-studio/blob/channel/major-11/Jenkinsfile#L227-L228 You can check how it works on https://freeyourmusic.com if you wish. (It is Electron 15.1.1) |
This was also being tracked in #3535, which was closed.
The latest version it works with is Electron 10.4.0.
Any Electron 11.x, 12.x or even beta 13.x crashes the app.
We can see that Electron crashes the moment that Realm is initialized.
If you need, we can provide you executable of exactly the same code built with Electron 10.4.0 (that works) and Electron 12.0.0 which crashes.
The workaround for us is to ship Electron 10.4.0 for Windows users and Electron 12.0.0 for the rest of the platforms (so we can support ARM64 on Apple).
Any suggestions how we can debug the issue would be much appreciated. The only info we have is
Backtrace: PackageSidFromProductId
The text was updated successfully, but these errors were encountered: