electron Uncaught ReferenceError: require is not defined at recorder.js:1

JavaScript
app.on('ready', () => {
    mainWindow = new BrowserWindow({
        webPreferences: {
            nodeIntegration: true
        }
    });
});
Source

Also in JavaScript: