title: NodeJS Broadcast channel only working 1 way
body: <p>I have an advanced server controlling multiple APIs and threading wherever possible.</p>
  <p>There is 2 main threads, a threadHub * uiThread.</p>
  <p>They are using broadcastchannel to communicate.</p>
  <pre class="lang-js prettyprint-override"><code>var bc = new BroadcastChannel('main', {
     type: 'node',
     webWorkerSupport: true
   })
  </code></pre>
  <p>The threadHub uses this to get all messages where it sends it to a function that properly processes it.
  It succesfully receives all messages send out.</p>
  <pre class="lang-js prettyprint-override"><code>bc.onmessage = (event) =&gt; {
      var data = event.data;
      include.threading.getData(data);
  };
  </code></pre>
  <p>The uiThread uses the same method but never receives any messages not even from self.</p>
  <pre class="lang-js prettyprint-override"><code>bc.onmessage = (event) =&gt; {
    var temp = event.data;
    print(`DATA: ${temp}`)// print calls a seperate function where the data is sent to the threadHub which controls STDOUT and logs it. This function does work.
    var buffer = temp.split(&quot;|&quot;);
    var threadId = buffer[0];
    var dataType = buffer[1];
    var data = buffer[2];
    if (!threadId == &quot;-1&quot;) return 1;
    switch (dataType) {
      case &quot;log&quot;: {
        debug = debug + data;
        break;
      }
    }
  };
  </code></pre>
  <p>All messages are sent using <code>bc.postMessage(`0|${text}`)</code></p>
  <p>BroadcastChannel is defined here:</p>
  <pre class="lang-js prettyprint-override"><code>const {
    Worker, SHARE_ENV, isMainThread, parentPort, workerData, BroadcastChannel
  } = require('worker_threads');
  </code></pre>
  <p>So my question is why is <code>bc.onmessage</code> not working in uiThread but works flawlessly in threadHub?</p>