Not able to attach debugger for node js
Hi, I m unable to add the debugger..

I get this image and my launch.json looks like this { // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "name": "Docker: Attach to Node", "type": "node", "request": "attach", "port": 9229, "address": "localhost", "localRoot": "${workspaceFolder}", "remoteRoot": "/", "protocol": "inspector" } ] }
Additional info - I m using node:11-alpine and VS 1.48.1(user setup) and running the docker from docker compose using ports:
- "3030:3030"
- "9229:9229" command:
- node
- "--inspect-brk=0.0.0.0"
- "."
and in package.json i have "scripts": { "start": "node app.js" }, none of the breakpoints are hit. please suggest
docker extension is installed. Anything else that needs to be installed?
So basically i run the docker and then do f5 i do get some hit in app.js, as that the start point(eventhough no breakpoint is set)...but none of the other files are hit where actually the breakpoints are added.. and all the breakpoints also look detached
Please collect a trace log using the instructions in the issue template.
Closing due to lack of info. Please follow up if you're able to collect trace logs.
@connor4312 I have mailed you the trace file. PLease check if you can get a clue as to what might be the issue that the debugger doesnt get attached!
It looks like your localRoot/remoteRoot is incorrectly configured. You have, anonymized:
{
"localRoot": "C:\Users\USERNAME\ONEDRIVE\Documents\PROJECT\LocalDev",
"remoteRoot": "/",
}
And then set a breakpoint in c:\Users\USERNAME\ONEDRIVE\Documents\PROJECT\LocalDev\project-management-service\src\routes\user\list.js.
From the local and remote roots, we'd expect to find the file at /sentinel-management-service/src/routes/user/list.js, but it's actually at /usr/src/app/src/routes/user/list.js
Hi @connor4312 , thanks for the support. I m able to get the breakpoints to be hit on docker. Corrected the localRoot to point to the proper location.