After the recent update to Electron 5.0, there was a require is not defined error and the WebView did not display properly.
First let’s look at the update log for Electron:
You can see that nodeIntegration and WebViewTag are changed to false by default. So just set it to true.
myWindow = new BrowserWindow({ //... WebPreferences: {nodeIntegration: true, // Resolve the require is not defined problem WebViewTag: true // Resolve the problem that WebView cannot display})