title: How to fix BrowserWindow is not a constructor error when creating child window in Electron renderer process
body: <p>I'm using electron to build an application that includes two windows. I'm trying to open a second window from inside renderer process doing something like:</p>
  
  <pre><code>const electron = require('electron');
  const BrowserWindow = electron.BrowserWindow;
  
  const childWindow = new BrowserWindow({
     width: 800,
     height: 600
  });
  </code></pre>
  
  <p>I'm getting an error saying </p>
  
  <blockquote>
    <p>BrowserWindow is not a constructor.</p>
  </blockquote>
  
  <p>My other option is to use window.open, but that is not ideal since that returns BrowserWindowProxy object, which has limited functionality.</p>