Open ahmedmukhtar1133 opened 1 year ago
Switching from Realm Web to Realm JavaScript is not trivial. The two SDKs have the same API but they have two very different implementations.
@kneth
Here someone claims that realm-js needs to be externalized from webpack: https://github.com/realm/realm-js/issues/4157 we didn't do that. Could this be the reason? I just tried to add realm to externals like this, but didn't change anything. Same error.
externals: {
'realm': 'realm'
},
@stoefln
https://github.com/realm/realm-js/issues/4157 is an issue created by us to track the fix of it. Yes, it is likely you have found the solution.
@kneth sorry, like I wrote it doesn't help us to add the module to externals. So what do you mean by "It's likely you have found the solution"?
@stoefln Sorry for the late reply. Honestly I can't remember what I meant. Please take a look at Realm Studio's webpack configuration to see how our Electron is set up.
I found the problem came from not having realm in the /release/app/package.json as a dependency, so I just add it there and also add "@types/realm": "^1.13.0" in ./package.json in root folder to shut typescript up.
https://electron-react-boilerplate.js.org/docs/adding-dependencies https://github.com/amilajack/erb-sqlite-example - can look into this example since realm is similar to sqlite
How frequently does the bug occur?
All the time
Description
We were using
realm-websdk
in our electron app but that was producing some issue in production mode (crashing app due to native issue). So we are trying to replaceweb-sdk
withNodeJS-SDK
and it's giving error after installation.As we are installing package in existing app so we cannot change electron and nodejs version yet. So we are using fixed versions for electron and node for now.
Stacktrace & log output
Can you reproduce the bug?
Yes, always
Reproduction Steps
Version
v11.0.0
What SDK flavour are you using?
Atlas App Services (auth, functions, etc.)
Are you using encryption?
No, not using encryption
Platform OS and version(s)
MacOs M1 Chip
Build environment
ELECTRON: 12.3 REACTJS: 17.0.2 NodeJS: 14.17.0
Cocoapods version
1.11.2