VSCode debugger help

So I need some help with setting up a debugger. I have a dockercompose which runs like 7 docker containers. for the mian container which runs the server.ts the debugger works. If I use the same approac to create another debugger for another service which is like src/exports/exports.ts and make a debugger and launch.json for it, it can't connect I get the error no debugger found or something like that. When I try to curl ocalhost:<port> I get empty response is it a problem because the export.ts is not a server but just a Script that runs on the container? is there something I can do to make the debugger work? this is my launch.json
{
"name": "Docker: Attach to App",
"type": "node",
"request": "attach",
"port": 9229,
"address": "localhost",
"localRoot": "${workspaceFolder}/src/exports",
"remoteRoot": "/app/src/exports",
"protocol": "inspector"
}
{
"name": "Docker: Attach to App",
"type": "node",
"request": "attach",
"port": 9229,
"address": "localhost",
"localRoot": "${workspaceFolder}/src/exports",
"remoteRoot": "/app/src/exports",
"protocol": "inspector"
}
ERROR: Error: Could not connect to debug target at http://localhost:9229: Could not find any debuggable target
Solution:
Solution - On all NPM scripts add: --inspect=0.0.0.0:9229
Jump to solution
2 Replies
neochrome
neochromeOP17mo ago
some new findings if I set the port to 9229:9229 on the one that does not work.. the debugger attaches However currently no breakpoints triggereing as they are grayed out
Solution
neochrome
neochrome17mo ago
Solution - On all NPM scripts add: --inspect=0.0.0.0:9229
Want results from more Discord servers?
Add your server