Im trying to get vscode debugger to work with an application generated with AWS Sam, but with TypeScript.
So before I added TypeScript, the debugger worked fine, I could reach the breakpoints without issue. When I added TypeScript, I had to change to folder structure, by adding a src and dist folder, so currently my file structure is like this:
According to AWS documentation (page 58): https://docs.aws.amazon.com/toolkit-for-vscode/latest/userguide/aws-tookit-vscode-ug.pdf I think it has to do with the pathMappings in the launch.json file, but I can't seem to figure out what would the correct path. This is my current launch.json file:
{
"configurations": [
{
"type": "aws-sam",
"request": "direct-invoke",
"name": "puppeteer-pdfMerger:HelloWorldFunction",
"invokeTarget": {
"target": "template",
"templatePath": "puppeteer-pdfMerger/template.yaml",
"logicalId": "HelloWorldFunction"
},
"lambda": {
"runtime": "nodejs12.x",
"payload": {},
"environmentVariables": {},
"pathMappings": [{
"localRoot": "${workspaceFolder}/puppeteer-pdfMerger/hello-world/dist/HelloWorldFunction",
"remoteRoot": "/var/task/dist"
}]
}
}
}
I will note that when running this configuration the containerized Lambda runs fine, it's just the breakpoints are not working.