Skip to content

Making debugger work with nodemon and babel-node #127

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ganapativs opened this issue Sep 4, 2018 · 3 comments
Closed

Making debugger work with nodemon and babel-node #127

ganapativs opened this issue Sep 4, 2018 · 3 comments
Assignees

Comments

@ganapativs
Copy link

When trying to debug with vscode, debugger gets attached, breakpoint gets added(shows proper red dot). but, the control won't stop at breakpoint.

But, in chrome inspect(chrome://inspect), everything works fine.

The app is running inside docker.

command(notice babel-node here):
nodemon --delay 5 --inspect=0.0.0.0:9229 -w src --exec \"babel-node src\"

launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "node",
            "request": "attach",
            "name": "Attach to crazy app",
            "port": 9229,
            "address": "localhost",
            "sourceMaps": true,
            "remoteRoot": "/root/app/",
            "localRoot": "${workspaceRoot}", // app is workspace root and has src folder
            "smartStep": true,
            "restart": true
        }
    ]
}

What am I missing here?

@ganapativs ganapativs changed the title Make debugger work when using with nodemon and babel-node Making debugger work when using with nodemon and babel-node Sep 4, 2018
@ganapativs ganapativs changed the title Making debugger work when using with nodemon and babel-node Making debugger work with nodemon and babel-node Sep 4, 2018
@dbstratta
Copy link

Hi @ganapativs!

Have you tried adding sourceMapPathOverrides in your launch.json?

Something like this:

"sourceMapPathOverrides": {
  "/root/app/*": "${workspaceFolder}/*"
},

Here is my launch.json:

{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "node",
      "request": "attach",
      "name": "Attach to API",
      "protocol": "inspector",
      "restart": true,
      "sourceMaps": true,
      "processId": "${command:PickProcess}",
      "stopOnEntry": false,
      "smartStep": true,
      "address": "localhost",
      "port": 9229,
      "localRoot": "${workspaceFolder}/projects/api/",
      "remoteRoot": "/usr/src/app/",
      "timeout": 5000,
      "showAsyncStacks": true,
      "sourceMapPathOverrides": {
        "/usr/src/app/*": "${workspaceFolder}/projects/api/*"
      },
      "skipFiles": [
        "usr/src/app/node_modules/**/*.js",
        "<node_internals>/**/*.js"
      ]
    }
  ]
}

@ganapativs
Copy link
Author

@strattadb I don't remember if I did that. I'll try this today and let you know 👍

@auchenberg
Copy link
Contributor

Closing due to no activity.

@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants