title: Debugging Worker thread in electron
body: <p>I'm testing out worker_thread on an electron application.  I'm currently using version 11.0.2.</p>
  <p>The code is simple and is working and returning the sample data but I cant seem to step into the code.</p>
  <p>Main Process:</p>
  <pre><code>import { Worker, isMainThread, workerData } from 'worker_threads';
  
  
    config.ipcMain.on('entries:search', (evt: any, opts: any) =&gt; {
      if (isMainThread) {
          const pathWorker = path.join(__dirname, '../data/entries_worker.js');
          const worker = new Worker(pathWorker, {
              workerData: opts.value,
          });
          worker.on('message', (data) =&gt; {
              debugger;
              const d = 1;
          });
  
          worker.on('error', (data) =&gt; {
              debugger;
              const d = 1;
          });
  
          worker.on('exit', (data) =&gt; {
              debugger;
              const d = 1;
          });
      }
    });
  </code></pre>
  <p>The worker file code:</p>
  <pre><code>import { workerData, parentPort } from 'worker_threads';
  debugger;
  parentPort.postMessage({ status: 'Done' });
  </code></pre>
  <p>I'm using Visual Studio Code and I do put breakpoints and event the debugger statement but it never seems to break into the worker file.</p>
  <p>The message event does receive the response from the script { status: 'Done' } and the exit event returns 0.</p>
  <p>Any ideas on how I can stop at the breakpoint in the worker file entries_worker.js?</p>
  <p><strong>Update</strong></p>
  <p>Found the following <a href="https://github.com/nodejs/node/issues/26609" rel="nofollow noreferrer">link</a> about how it's not available right now.  I'm not 100% sure if it has changed</p>