title: Electron - Uncaught TypeError: Cannot read properties of undefined (reading 'showOpenDialog')
body: <p>I'm trying to open the dialog on electron, but I'm getting this error:</p>
  <pre><code>Uncaught TypeError: Cannot read properties of undefined (reading 'showOpenDialog')
  </code></pre>
  <p>I've already visited several forums and communities to see if I have a solution to my problem. But none resolved perhaps because of the version.</p>
  <p>The version of electron I currently use is <code>16.0.5</code></p>
  <p>This answer didn't help me much</p>
  <p><a href="https://stackoverflow.com/a/63756725/14271847">https://stackoverflow.com/a/63756725/14271847</a></p>
  <p>I won't leave all of my main.js, but the part I changed is this one, <code>enableRemoteModule</code>:</p>
  <pre><code>  const mainWindow = new BrowserWindow({
      width: 800,
      height: 600,
      webPreferences: {
        enableRemoteModule:true,
        nodeIntegration: true,
        contextIsolation: false,
        preload: path.join(__dirname, 'preload.js')
      }
    })
  </code></pre>
  <h2>file test.js</h2>
  <p>And here's what I'm trying to do on electron, following what's in this <a href="https://www.electronjs.org/docs/latest/api/dialog" rel="nofollow noreferrer">link</a></p>
  <pre><code>const { dialog } = require('electron')
  console.log(dialog.showOpenDialog({ properties: ['openFile', 'multiSelections'] }))
  </code></pre>
  <p>I've tried it with the remote, but it doesn't work:</p>
  <pre><code>const { dialog } = require('electron')
  console.log(dialog.remote.showOpenDialog({ properties: ['openFile', 'multiSelections'] }))
  </code></pre>
  <p>Could someone help please?</p>