title: Electron JS - Cannot destructure property 'BrowserWindow' of 'require(...).remote' as it is undefined
body: <p><strong>This is in Renderer Process:</strong></p>
  <pre><code>
  const {BrowserWindow} = require('electron').remote
  
  const path = require('path')
  const url = require('url')
  
  const newWindowButton = document.getElementById('new-window-btn');
  newWindowButton.addEventListener('click',(e)=&gt;{
      let win3 = new BrowserWindow();
      win3.loadURL(url.format({
          pathname: path.join(__dirname,'index3.html'),
          protocol: &quot;file&quot;,
          slashes: true
      }))
  
  })
  </code></pre>
  <p><strong>I am not able to open a new window in renderer process, getting the below error.</strong></p>
  <p>**Uncaught TypeError: Cannot destructure property 'BrowserWindow' of 'require(...).remote' as it is</p>
  <pre><code>undefined.**
      at Object.&lt;anonymous&gt; (D:\ElectronTute\helloWorld\index1.js:4)
      at Object.&lt;anonymous&gt; (D:\ElectronTute\helloWorld\index1.js:21)
      at Module._compile (internal/modules/cjs/loader.js:1145)
      at Object.Module._extensions..js (internal/modules/cjs/loader.js`enter code here`:1166)
      at Module.load (internal/modules/cjs/loader.js:981)
      at Module._load (internal/modules/cjs/loader.js:881)
      at Function.Module._load (electron/js2c/asar.js:769)
      at Module.require (internal/modules/cjs/loader.js:1023)
      at require (internal/modules/cjs/helpers.js:77)
      at index1.html:13
  </code></pre>