title: Cannot read property 'send' of undefined Electronjs Error
body: <p>Im trying to send some data back to my main page within electron but im having some troubles as im currently getting the error shown in the title. I've tried some solutions that are on stackoverflow but none seems to be working for me or i did not implement them correctly. Any suggestions/help would be appreciated.</p>
  
  <p>Main.js:</p>
  
  <pre><code>  let win
    win = new BrowserWindow({ width: 800, height: 600 })
    win.loadFile('src/index.html') 
  
    ipcMain.on('Request:bloodType', function(event, item){
      console.log(item);
      win.webContents.send('Request:bloodType', item)
      createRequestDonor.close();
  
    })
  </code></pre>
  
  <p>Where i am trying to send data from:</p>
  
  <pre><code>  const { ipcRenderer } = require('electron').ipcRenderer;
    const form = document.querySelector('form')
    form.addEventListener('submit', submitForm);
  
    function submitForm(e){
      const bloodType = document.getElementById("bloodType").value;
      e.preventDefault();
      ipcRenderer.send('Request:bloodType', bloodType); // Error on this specific line ---
  }
  </code></pre>