vscode debugger wont connect to awaiting debugger

29 Views Asked by At

I am working on aws project. i am using the following configuration to start the debug process sam local start-api -d 5858

when i trigger a lambda from postman, i see that the triggered corresponding lambda starts and it waits for debugger to be attached.

When i attach using what i defined in my launch.json the debugger attempts to start and crashes. the debug session still waits for debugger to connect to it.

debugger crashes and waits to be connected to (this is after 3 crashes)

2024-03-08 20:25:46 WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
 * Running on http://127.0.0.1:3000
2024-03-08 20:25:46 Press CTRL+C to quit
Invoking index.handler (nodejs18.x)                                                            
Local image is up-to-date                                                                      
Using local image: public.ecr.aws/lambda/nodejs:18-rapid-x86_64.                               
                                                                                               
Mounting                                                                                       
/Users/d/Documents/workspace/XY-service/dist/helloworld
as /var/task:ro,delegated, inside runtime container                                            
START RequestId: a0fb952c-2685-4e2f-9b26-646d07d2421d Version: $LATEST
Debugger listening on ws://0.0.0.0:5858/23bb5c37-92ee-4eae-9554-60b266c099d8
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
Debugger ending on ws://0.0.0.0:5858/23bb5c37-92ee-4eae-9554-60b266c099d8
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
Debugger ending on ws://0.0.0.0:5858/23bb5c37-92ee-4eae-9554-60b266c099d8
For help, see: https://nodejs.org/en/docs/inspector

the error in output vscode tab : Could not connect to debug target at http://localhost:5858

2024-03-08 19:58:58.110 [info] [perf] Render performance baseline is 35ms
2024-03-08 20:16:10.313 [error] [Extension Host] Error: Could not connect to debug target at http://localhost:5858: Could not find any debuggable target
    at /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/ms-vscode.js-debug/src/extension.js:120:38167
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async n (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/ms-vscode.js-debug/src/extension.js:124:3699)
    at async Pp.launch (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/ms-vscode.js-debug/src/extension.js:123:31587)
    at async Vw.captureLaunch (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/ms-vscode.js-debug/src/extension.js:140:11414)
    at async Vw._launch (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/ms-vscode.js-debug/src/extension.js:140:11161)
    at async Promise.all (index 5)
    at async Vw._boot (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/ms-vscode.js-debug/src/extension.js:140:10285)
    at async /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/ms-vscode.js-debug/src/extension.js:140:9164
    at async Ou._onMessage (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/ms-vscode.js-debug/src/extension.js:57:4835)
2024-03-08 20:16:31.735 [error] Extension host (LocalProcess pid: 95657) terminated unexpectedly. No extensions were activated.
2024-03-08 20:16:31.738 [info] Automatically restarting the extension host.
2024-03-08 20:16:31.913 [info] Started local extension host with pid 1244.

my launch.json

        {
            "type": "node",
            "request": "attach",
            "name": "Attach to helloworld-get",
            "port": 5858,
            "address": "localhost",
            "localRoot": "/Users/d/Documents/workspace/XY-service/dist/helloworld-get",
            "remoteRoot": "/var/task",
            "skipFiles": [
                "<node_internals>/**"
            ],
            "continueOnAttach": true,
            "sourceMaps": true,
            "outFiles": [
                "${workspaceFolder}/dist/**/*.js"
            ]
        },

My question is why isn't the debugger not able to connect to the running app that is waiting to be connected to at ws://0.0.0.0:5858/23bb5c37-92ee-4eae-9554-60b266c099d8

0

There are 0 best solutions below