Skip to content

Is it possible to debug nodejs server with workers? #30197

Description

@gsbelarus

Is it possible to debug workers? Every time I try, I get:

Starting inspector on 127.0.0.1:49344 failed: address already in use
Error: child process exit with code 12: connection problem

As soon as worker is created.

I use VS Code and launch.json looks like:

    {
      "type": "node",
      "request": "launch",
      "name": "Debug gdmn-back",
      "cwd": "${workspaceRoot}/src/gdmn-back",
      "program": "${workspaceRoot}/src/gdmn-back/src/index.ts",
      "outFiles": [
        "${workspaceRoot}/src/gdmn-back/dist/src/**/*.js"
      ],
      "console": "externalTerminal",
      "internalConsoleOptions": "openOnSessionStart",
      "autoAttachChildProcesses": true
    },

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 ((

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions