[Solved] electron Error: Uncaught TypeError: Cannot read property ‘BrowserWindow‘ of undefined

Electronic version 16+

There is a problem when using the remote module. The code is as follows:

const BrowserWindow = require(‘electron’). remote. BrowserWindow;

report errors:

Uncaught TypeError: Cannot read property ‘BrowserWindow’ of undefined

Solution:

1. Install remote:

npm install –save @electron/remote

2. demo2.js:

3. main.js:

It’s ready to run. The version of electron is updated too fast, and the rules are changed too fast.

Read More: