vscode-js-debug icon indicating copy to clipboard operation
vscode-js-debug copied to clipboard

Provide additional path mappings, beside root in the attach configuration

Open piejanssens opened this issue 2 years ago • 3 comments

Is your feature request related to a problem? Please describe.

This is my launch config to attach a remote debugger to an application deployed in Cloud Foundry:

    {
      "name": "Attach to a Cloud Foundry Instance on Port 9229",
      "port": 9229,
      "request": "attach",
      "type": "node",
      "localRoot": "${workspaceFolder}",
      "remoteRoot": "/home/vcap/app"
    },

Cloud Foundry's NodeJS buildpack will install dependencies in /home/vcap/deps/0/node_modules. I cannot hit breakpoints that I set in my local node_modules directory tree as the launch config is set to map the root to /home/vcap/app.

Describe the feature you'd like I would like to have the possibility to map specific paths other than root.

At the moment my suboptimal workaround is Node.js debugging via Chrome, where I am able tot navigate the remote structure and set breakpoints in /home/vcap/deps/0/node_modules. Screenshot 2023-02-15 at 13 48 01

piejanssens avatar Feb 15 '23 11:02 piejanssens

Hey @connor4312 are other breakpoints triggering for you? I am using CAP with Typescript and having big issues to get the TS breakpoints bound to the CF App js files, which have the Sources inlined. May we can help each other...

stevusprimus avatar Feb 14 '25 14:02 stevusprimus

... and I think your problem is caused by the node_modules being symlinked ....

Image

stevusprimus avatar Feb 14 '25 14:02 stevusprimus

+1 I would welcome that feature. We are using pnpm to manage a monorepo and the simple mapping can't cope with that. Would it be possible to have an array pathMappings in addition to the two static values that are supported currently?

ofrzeta avatar Sep 17 '25 06:09 ofrzeta