electron v10.1.1 gives Uncaught TypeError: Cannot read property 'dialog' of undefined, but same code works in electron v9.3.0

const win = new BrowserWindow({ 
    width: 800, 
    height: 600, 
    webPreferences: { 
         enableRemoteModule: true,
         nodeIntegration: true
    } 
}) 

In order to access the remote module on the renderer process. We need to enable enableRemoteModule as true as this is default false from the newer version.


as @tpikatchu stated:

const win = new BrowserWindow({ 
    width: 800, 
    height: 600, 
    webPreferences: { 
         enableremotemodule: true,
         nodeIntegration: true
    } 
})

but enableremotemodule: true
has to be in camelCase: enableRemoteModule: true

reference: https://www.electronjs.org/docs/api/browser-window

p.s: Sorry for the new answer creation, but I can't comment yet.