title: Electron reply error: An object could not be cloned
body: <p>I'm trying to ask the main application to find some kind of device, I have been trying to do it with ipc but couldn't make it work either with asynchronous send and sync send. I suspect that the main is trying to reply the promise.</p>
  <p>Renderer:</p>
  <pre><code>const recognizedDevices = ipcRenderer.sendSync('findDevice');
  console.log(recognizedDevices);
  </code></pre>
  <p>Main:</p>
  <pre><code>ipcMain.on('findDevice', (event) =&gt; findDevice(event));
  const findDevice = async (event) =&gt; {
    let recognizedDevices = await findConnectedDevices();
    if(recognizedDevices){
    console.log(&quot;found&quot;);
    console.log(recognizedDevices);
    return event.returnValue = recognizedDevices;
    }
  //TODO: If no device found
  }
  </code></pre>
  <p>Result in main:</p>
  <pre><code>    found
  [
    HID {
      _events: [Object: null prototype] { newListener: [Function (anonymous)] },
      _eventsCount: 1,
      _maxListeners: undefined,
      _raw: HID {},
      write: [Function: bound write],
      getFeatureReport: [Function: bound getFeatureReport],
      sendFeatureReport: [Function: bound sendFeatureReport],
      setNonBlocking: [Function: bound setNonBlocking],
      readSync: [Function: bound readSync],
      readTimeout: [Function: bound readTimeout],
      getDeviceInfo: [Function: bound getDeviceInfo],
      _paused: true,
      [Symbol(kCapture)]: false
    }
  ]
  </code></pre>
  <p>I was hoping to receive the same log result in the renderer, but unfortunately I am getting back <code>Error: An object could not be cloned.</code></p>
  <p>If I try to reply back with recognizedDevice.length I will indeed receieve &quot;1&quot; in the front end, so it seem like the communication between them is good. Seems like the problem is with sending the object.</p>