Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build native modules with electron runtime #70

Merged
merged 10 commits into from
Feb 19, 2021
Merged

Conversation

rkistner
Copy link
Member

Target electron runtime to build the name module with node-pre-gyp. This forces the external openssl library to be linked, instead of Node's one.

This now also runs tests using electron-mocha on Windows again.

The issue was that since version 5.0.0, we use the same native modules for both NodeJS and Electron, which is possible from using NAPI. But when building for Node, Node's internal OpenSSL symbols are used, and these are not available in Electron, causing a crash when running in Electron on Windows.

See this for details: https://www.electronjs.org/blog/electron-internals-using-node-as-a-library#shared-library-or-static-library

Fixes #67.

@epieddy
Copy link

epieddy commented Feb 19, 2021

Yes !! \o/ This seems very promising. My project has been stuck at Electron 9 for a very long time because of this issue. Hope this is the one.

Copy link
Contributor

@WesselWessels WesselWessels left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@rkistner rkistner merged commit 0ebed6d into master Feb 19, 2021
@rkistner rkistner deleted the build-with-electron branch February 19, 2021 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Electron crash on Windows on v5.0.0
3 participants