Skip to content

fix: avoid using native Node.js modules in the Electron renderer process. #1110

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Thulof
Copy link

@Thulof Thulof commented Mar 1, 2025

The current code mistakenly identifies the Electron renderer process as a Node.js environment. However, per Electron’s security best practices, the renderer process disables direct access to Node.js native modules (e.g., the crypto module) by default. This issue causes exceptions when using the node-forge library in the Electron renderer process (as reported in #1010 )

fix #1010
fix #602

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 encrypt an error n.randomBytes is not a function
1 participant