title: IPC Communication not working between Electron and window
body: <p>I am trying to write my first Electron app based on Electron Boilerplate. I am trying to send a simple message from the main Electron process into my window but it seems that the message is not getting send. </p>
  
  <p>The main code I've impmeneted is as follows</p>
  
  <p><strong>background.js ( main Electron process)</strong></p>
  
  <pre><code>// Window setup
  app.on("ready", () =&gt; {
    mainWindow = new BrowserWindow({
    width: 1000,
    height: 300,
    frame: false,
    resizable: false,
    transparent: true,    
    });  
    mainWindow.setIgnoreMouseEvents(true);
    mainWindow.hide();
  
    mainWindow.loadURL(
      url.format({
        pathname: path.join(__dirname, "app.html"),
        protocol: "file:",
        slashes: true
      })
    );
  
    const ret = globalShortcut.register(getKeyboardShortCut(), () =&gt; {
      mainWindow.isVisible ? mainWindow.hide() :  mainWindow.show();
    })
  
    if(isDev()){
      mainWindow.openDevTools();
      mainWindow.setIgnoreMouseEvents(false);
      console.log("======== DEV ==========");
      mainWindow.show();
      mainWindow.webContents.send('test','This is a test');
    }
  });
  </code></pre>
  
  <p><strong>app.js ( Window mapped to mainWindow )</strong> </p>
  
  <pre><code>import { ipcRenderer } from "electron";
  
  ipcRenderer.on('test', (event, text) =&gt; { console.log("Received test 
  message:", text)});
  console.log(ipcRenderer);
  </code></pre>
  
  <p>Any idea why the event is not getting received ? I see the console log that the DEV code is running but nothing on the app window side ( In the Developer console log ) The full code can be found at <a href="https://github.com/AnubisDenko/app-launcher" rel="nofollow noreferrer" title="Git Repo">Git Repo</a></p>
  
  <p>Any help would be appreciated.</p>
  
  <p>Thanks
  Oliver</p>