Skip to content
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

Making debugger work with nodemon and babel-node #127

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

Comments

@ganapativs
Copy link

@ganapativs ganapativs commented Sep 4, 2018

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
@strattadb

This comment has been minimized.

Copy link

@strattadb strattadb commented Nov 16, 2018

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

This comment has been minimized.

Copy link
Author

@ganapativs ganapativs commented Nov 16, 2018

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

@auchenberg

This comment has been minimized.

Copy link
Contributor

@auchenberg auchenberg commented Nov 21, 2018

Closing due to no activity.

@auchenberg auchenberg closed this Nov 21, 2018
@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.
Projects
None yet
3 participants
You can’t perform that action at this time.