0

We are using electron(Version - 18.2.1), electron-builder(Version - 22.14.13) for XMPP chat app by using database Realm Node.js SDK(Version - 11.2.0).

Also we are creating the builds for linux, MAC and windows.

Here two scenarios

  1. During the development
  2. After creating the build.

Scenario - 1 - In development it is crashed but in second trial its working.

Scenario - 2 - After creating the build found error. Error - /opt/local/resources/app.asar.unpacked/node_modules/realm/build/Release/realm.node: invalid ELF header

var Realm = require( "realm" );
var realm;

//  Open realm
let openRealm = async ( ) => {
        try {
            //  Get schemas
            const IMAccount = await schemaIMAccount();
            //  Config schemas
            config = {
                        path: "xmpp-realm",
                        schema: [IMAccount]
             }
            // Open realm
            realm = await Realm.open( config );
        } catch ( error ) {
            console.error( "XMPP - Error => ", error );
        }
}
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Nov 14 '22 at 12:36
  • Good day. Thanks for reply. Let me explain. We are using electron(Version - 18.2.1), electron-builder(Version - 22.14.13) for XMPP chat app by using database Realm Node.js SDK(Version - 11.2.0). Also we are creating the builds for linux, MAC and windows. Here two scenarios 1. During the development 2. After creating the build. Scenario - 1 - In development it is crashed but in second trial its working. Scenario - 2 - After creating the build found error. Error - /opt/local/resources/app.asar.unpacked/node_modules/realm/build/Release/realm.node: invalid ELF header. – Shrikant Thakar Nov 15 '22 at 04:26
  • Welcome to SO. Please don't put code in comments - it's really hard to read. Include code in your question. Also, the question is pretty vague; saying - *In development it is crashed* - doesn't really give us much to go on. Please take a moment and review [How to ask a good question](https://stackoverflow.com/help/how-to-ask) and [How to create a Minimal, Reproducible Example](https://stackoverflow.com/help/minimal-reproducible-example). Update your question, clearly describe what line is crashing and what troubleshooting you've done. – Jay Nov 15 '22 at 19:26
  • The error "invalid ELF header" indicates you're either mixing or installing the wrong package for your platform. I am pretty sure this is a duplicate question as it appears it's been asked [frequently](https://stackoverflow.com/search?q=invalid+ELF+header). I believe it's a duplicate of [this question and answer](https://stackoverflow.com/questions/29994411/invalid-elf-header-when-using-the-nodejs-ref-module-on-aws-lambda) if someone wants to mark it as a dup. – Jay Nov 18 '22 at 19:44

0 Answers0