I am using VS Code for development of AWS Lambda functions, I started using the serverless framework and the serverless offline library but, I am unable to use VS Code's debug mode to locally debug the code.
I am referring many sites, Following is one of them: https://medium.com/@OneMuppet_/debugging-lambada-functions-locally-in-vscode-with-actual-break-points-deee6235f590
My project structure is as follows:
Package.json
:
launch.json
:
I get the following error when I start debug:
Can someone please guide, with the correct configuration?
in the package.json add debug script:
"scripts": {
.......
"debug": "node --inspect node_modules/serverless/bin/serverless offline -s dev",
.........
}
VS code lunch.json
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"cwd": "${workspaceFolder}",
"name": "Serverless",
"runtimeExecutable": "npm",
"runtimeArgs": [
"run",
"debug"
],
"port": 9229
}
]
}
Then start debugging from VS code
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With