Neon: "Error: Module did not self-register." in Electron 4.0.1 on Windows(but works fine in 3.1.1)

Created on 23 Jan 2019  路  5Comments  路  Source: neon-bindings/neon

OS: Windows 10 1809
Rust version: 1.32.0 x86_64 MSVC
Electron version: 4.0.1
Neon binding version: 0.2.0
Node.js version: 10.15.0

How to reproduce:

  1. Clone the neon-binding example repo: https://github.com/neon-bindings/examples
  2. Change the electron version from 3.0.10 to 4.0.1 in packages.json under electron-app
  3. yarn and then yarn start

Got the following log in the electron window:

Error: Module did not self-register.
    at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:160:31)
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:722:18)
    at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:160:31)
    at Module.load (internal/modules/cjs/loader.js:602:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:541:12)
    at Function.Module._load (internal/modules/cjs/loader.js:533:3)
    at Module.require (internal/modules/cjs/loader.js:640:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object. (C:\examples\electron-app\node_modules\neon-hello\lib\index.js:1:168)
    at Object. (C:\examples\electron-app\node_modules\neon-hello\lib\index.js:5:3)

It doesn't reproduce under electron v3, is there any way to debug what's happening?

electron enhancement requires v8 c++

Most helpful comment

All 5 comments

Considering that 4.0.1 is a pretty recent major server of electron, it is likely that this might be an electron issue.

I see exactly the same behaviour - works fine for me on Windows 10 with Electron 3.0.10, but couldn't get it work on 4.0.X.

Any ideas?

In my own project i have the same problem. Electron 4.1.4 gives the error above. Downgrading to electron 3.1.8 and it works. Definitely something weird going on.

Other native modules (non neon) seem do work (integer and better-sqlite3). If there is any way to debug this, i'd not mind giving it a try.

I looked at what changed in electron 4 and found https://electronjs.org/docs/tutorial/using-native-node-modules#a-note-about-win_delay_load_hook which might be the cause

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rm-rf-etc picture rm-rf-etc  路  3Comments

phrohdoh picture phrohdoh  路  6Comments

crazyfrozenpenguin picture crazyfrozenpenguin  路  3Comments

manuel2258 picture manuel2258  路  5Comments

thehappycoder picture thehappycoder  路  3Comments