You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Is it possible to debug nodejs server with workers? #30197
I think, if it is NOT POSSIBLE at all, it should be printed with bold letters at the start of corresponding chapter of Nodejs docs. So, there will be no need to spend days searching internet for a solution which doesn't exist.
If there is a way, then it would be good to add it to official docs. As both nodejs and vscode web sites don't say a word about the topic.
I love Nodejs, but inability to debug workers code makes me mad ((
ndb node ./dist/src/index.js (path will depend on project!)
if you need to set break point before project starts open ndb with command ndb ., browse to sources and put break point, then follow Consistent sync and async function names #5.
Activity
addaleax commentedon Oct 31, 2019
@gsbelarus Are you talking about
worker_threadsworkers orclusterworkers?If it’s
worker_threadsworkers, Chrome DevTools doesn’t support them yet but e.g. https://github.com/GoogleChromeLabs/ndb/ and some IDEs do.If it’s cluster workers, yes, that is possible. If necessary, you can manually specify a port using
inspectPort: https://nodejs.org/api/cluster.html#cluster_cluster_settingsgsbelarus commentedon Oct 31, 2019
We use
worker_threads. I will evaluate ndb. Thanks for the link!gsbelarus commentedon Oct 31, 2019
Seems it works for me:
yarn global add ndbcdto project folderyarn rebuildndb node ./dist/src/index.js(path will depend on project!)ndb ., browse to sources and put break point, then follow Consistent sync and async function names #5.doc: add note about debugging worker_threads
doc: add note about debugging worker_threads
doc: add note about debugging worker_threads
doc: add note about debugging worker_threads
danieltroger commentedon Nov 7, 2023
Is there any way of doing this now that ndb is dead/deprecated? ndb crashes for me and I really want a debugger in worker_threads