I am new to electron js and I am trying to use devtron. When I use require in the Electron Browser Window. I face this error
Uncaught ReferenceError: require is not defined
Please note that I am getting this error when using require in BrowserWindow, not in the code. I have also tried setting nodeIntegration: true, and contextIsolation: true in webPreferences. I have attached the screenshot.
Here is my code of main.js
const {app, BrowserWindow} = require('electron')
const path = require('path')
require('electron-reload')(__dirname);
function createWindow () {
const mainWindow = new BrowserWindow({
width: 1000,
height: 700,
webPreferences: {
preload: path.join(__dirname, 'preload.js'),
nodeIntegration: true,
contextIsolation: true
}
})
mainWindow.loadFile('index.html')
}
app.whenReady().then(() => {
createWindow()
app.on('activate', function () {
if (BrowserWindow.getAllWindows().length === 0) createWindow()
})
});
