Can VS Code's Javascript debugger be made to debug node 11's new "Worker Threads"? Worker threads are modelled after web workers with a small number of extra capabilities on top and are available from the new worker_threads package (see https://nodejs.org/api/worker_threads.html). Other than with node's sub processes, one can share memory with worker threads in the form of SharedArrayBuffers.
My VS Code launch configuration looks like that:
{
"type": "node",
"request": "launch",
"name": "Mocha Tests",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"runtimeArgs": [
"--experimental-wasm-threads",
"--experimental-worker"
],
"args": [
"-u", "tdd",
"--timeout", "100000",
"--colors", "${workspaceFolder}/test"
],
"internalConsoleOptions": "openOnSessionStart",
"autoAttachChildProcesses": true
}
I can debug into the main node script, but the "autoAttachChildProcesses" flag is not effective in attaching to the spawned off worker threads and neither is adding a "debugger" statement within the code that runs inside the worker thread.
They mention that the "inspector" package is not yet supported for worker threads in their reference documentation, so I guess this may explain why that is.
Against all these odds, has anyone still succeeded in debugging into worker threads inside VS Code?