Is nodeIntegration required?
See original GitHub issueHey,
I have been reading up on Electron best practices and the official docs recommend turning off nodeIntegration
for any renderer that loads remote content.
In my app, I use a preload script to expose any node modules that I need in the renderer process. Everything else is handled via IPC
.
nodeIntegration
is not required in my app. Turning it off , however, breaks the app. It just doesn’t launch.
Error message
Root cause
I tried using a new project, disabled nodeIntegration
and the error still appeared. There are few issues on Github about this and the solution is always
Enable nodeIntegration
Is this a bug or expected behavior?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:8
- Comments:11 (7 by maintainers)
Top Results From Across the Web
Would it be safe to enable nodeIntegration in Electron on a ...
Keep in mind, that in year 2021 you do not need nodeIntegration to communicate with the main process from the renderer process.
Read more >Required not defined BUT nodeIntegration SET TO TRUE
I used electron-forge The code: index.js: const { app, BrowserWindow } = require('electron'); const path = require('path'); // Handle…
Read more >Electron FAQ
Due to the Node.js integration of Electron, there are some extra symbols inserted into the DOM like module , exports , require ....
Read more >Electron Node Integration - Quasar v1
If you turn off the node integration, then in the renderer thread you won't be able to: Import Node.js packages (like “fs”, “path”,...
Read more >Developing with Electron - GitHub Pages
js is run before the html file is loaded and can include Node-style requires even if the rest of the window has no...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
nodeIntegration
is now disabled by default on the v2.0.0 beta, and can be configured.Same question