Per the AWS documentation, I am starting SAM local like this:
$ sam local start-api -d 5858
I have the following in my launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach to SAM Local",
"type": "node",
"request": "attach",
"address": "localhost",
"port": 5858,
"localRoot": "${workspaceRoot}",
"remoteRoot": "/var/task"
}
]
}
But when I launch the visual studio debugger it says"cannot connect to runtime make sure that runtime is in 'legacy' debug mode"
It looks as though many people have this issue with Node.js 6 and Visual Studio Code but I can't seem to find an answer... I'm using version 1.18.1 of Visual Studio Code
I have tried adding "protocol": "Legacy" to launch.json config. I've also tried using --debug-port instead of -d. I'm on Windows 10. Not sure if the issue is windows-specific.