Package errors on Realm with Electron using Angular

Hi,

I am trying to using Realm nodejs sdk on an electron app which uses Angular components.

When I try to build the app, i get errors such as below.

In reality, since my app is purely electron and not going to run on browser as a web-app i am not expecting dependency to below.

Did anybody face this issue?

ERROR in ./node_modules/node-pre-gyp/lib/unpublish.js
Module not found: Error: Can’t resolve ‘aws-sdk’ in ‘C:\SLBCodeevvv\FDPUI\apps\ElectronAngularRealm\node_modules\node-pre-gyp\lib’

ERROR in ./node_modules/node-pre-gyp/lib/publish.js
Module not found: Error: Can’t resolve ‘aws-sdk’ in ‘C:\SLBCodeevvv\FDPUI\apps\ElectronAngularRealm\node_modules\node-pre-gyp\lib’

ERROR in ./node_modules/node-pre-gyp/lib/info.js
Module not found: Error: Can’t resolve ‘aws-sdk’ in ‘C:\SLBCodeevvv\FDPUI\apps\ElectronAngularRealm\node_modules\node-pre-gyp\lib’

ERROR in ./node_modules/realm/lib/browser/index.js
Module not found: Error: Can’t resolve ‘react-native’ in ‘C:\SLBCodeevvv\FDPUI\apps\ElectronAngularRealm\node_modules\realm\lib\browser’

Thanks,
Venkat

Hi, Can you elaborate a bit about how do you get this error. What does it means “When I try to build the app”. Are you packaging the app using electron-packager or something else.

I would suggest looking into our docs for Electron here https://docs.mongodb.com/realm/sdk/node/integrations/
also there is a sample project you could look at here https://github.com/mongodb-university/realm-electron-advanced-quickstart

If you need to update realm in these samples you could do a npm install realm@latest

I tried to reproduce the error you get but I couldn’t on my machine.

cheers