I'd expect to access process
object in my renderer process
Chrome dev tools throw ReferenceError
while accessing to process
object.
Uncaught ReferenceError: process is not defined
@msudgh nodeIntegration
is turned off by default in 5
, so you'll need to enable it via:
const { BrowserWindow } = require('electron')
let win = new BrowserWindow({
webPreferences: {
nodeIntegration: true
}
})
which we caution against, or add it via preload script.
@codebytere Thanks. it'd be better to update docs. this functionality existed in previous versions.
@msudgh this information was presented both in release notes and in breaking change documentation leading up to and including the stable release :)
Thanks it worked for me, you don't that how happy now I am thank you very very much...
Thank you very much. Now I can solved my problem!
const { BrowserWindow } = require('electron')
let win = new BrowserWindow({
webPreferences: {
nodeIntegration: true
}
})
@msudgh
nodeIntegration
is turned off by default in5
, so you'll need to enable it via:const { BrowserWindow } = require('electron') let win = new BrowserWindow({ webPreferences: { nodeIntegration: true } })
which we caution against, or add it via preload script.
Where to add this above code?
@msudgh
nodeIntegration
is turned off by default in5
, so you'll need to enable it via:const { BrowserWindow } = require('electron') let win = new BrowserWindow({ webPreferences: { nodeIntegration: true } })
which we caution against, or add it via preload script.
Where to add this above code?
In your electron apps main.js
file, check the project package.json
file -- the "main"
parameter shows the files path
Most helpful comment
@msudgh
nodeIntegration
is turned off by default in5
, so you'll need to enable it via:which we caution against, or add it via preload script.