title: Can't resolve 'fs' in \node_modules\electron
body: <p>I am using the electron-react boilerplate and want to use an electron <code>dialog</code> in App.tsx:</p>
  <pre><code>const { dialog } = require('@electron/remote') //also tried with import
  
  const Hello = () =&gt; {
    const readFromFile = async () =&gt; {
      dialog.showOpenDialog({})
    }
    return (
      &lt;&gt;
        &lt;button onClick={() =&gt; readFromFile()} &gt;Test&lt;/button&gt;
      &lt;/&gt;
    )
  }
  </code></pre>
  <p>in main.ts I placed the following line at the top</p>
  <pre><code>require('@electron/remote/main').initialize()
  </code></pre>
  <p>In the end I always get this error:</p>
  <pre><code>Module not found: Error: Can't resolve 'fs' in 'C:\Users\myUsername\source\repos\electronTest\node_modules\electron'
  </code></pre>
  <p>I also tried <code>nodeIntegration: true</code> and <code>contextIsolation: false</code></p>