electron / rebuild

Package to rebuild native Node.js modules against the currently installed Electron version
MIT License
1.03k stars 175 forks source link

Error: A dynamic link library (DLL) initialization routine failed. #252

Open kovzol opened 6 years ago

kovzol commented 6 years ago

There is an issue on Windows 10 when trying to compile https://github.com/kovzol/giac-electron-example. It runs nicely with electron 1.6.2 and electron-rebuild 1.5.11, but when changing electron-rebuild to 1.6.0 it fails. I am using the following procedure on building the application:

  1. I follow https://www.npmjs.com/package/giac to set LIBDIR to find the correct .LIB files and put the .DLL files in the correct folder.
  2. I change package.json to have the right version numbers I want to test.
  3. I issue "npm install && npm rebuild && npm install && npm start". Now when using v1.5.11 the application starts nicely, but for v1.6.0 I get an error:
    Error: A dynamic link library (DLL) initialization routine failed.
    \\?\C:\Users\test\giac-electron-example\build\giac.node
    at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:173:20)
    at Object.Module._extensions..node (module.js:598:18)
    at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:173:20)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at bindings (C:\Users\test\giac-electron-example\node_modules\bindings\bindings.js:76:44)
    at Object.<anonymous> (C:\Users\test\giac-electron-example\main.js:12:31)

    I learned that there were some changes between v1.5.11 and v1.6.0 including https://github.com/electron/electron-rebuild/commit/04668e33c24f7a39cc6b398a7c8c9790cdf6ddd6 and https://github.com/electron/electron-rebuild/commit/2987581a10fbc724c638066c1ad67284972f3c10 that may be relevant. I also tried to run electron-rebuild with the option "-t prod,dev" but it fails for both v1.5.11 and v1.6.0. I haven't experienced any problems on Linux. Newer versions of electron or electron-rebuild result in similar issues, so I guess the regression appeared in v1.6.0. Thanks in advance for some words of wisdom.

kovzol commented 6 years ago

I am completely confused because it is difficult to reproduce the same behavior. Now it seems 1.5.7 works but 1.5.8 not.