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:
https://github.com/neon-bindings/examples3.0.10 to 4.0.1 in packages.json under electron-appyarn and then yarn startGot 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?
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
And I got it working. See https://github.com/jrd-rocks/neon/blob/electron_delay_hook/README%20ELECTRON%204.md
And I got it working. See https://github.com/jrd-rocks/neon/blob/electron_delay_hook/README%20ELECTRON%204.md
404
Wow, it's amazing!
Most helpful comment
And I got it working. See https://github.com/jrd-rocks/neon/blob/electron_delay_hook/README%20ELECTRON%204.md
404