Closed Rapol closed 4 years ago
Hi @Rapol. The easiest way that we have found is just to run sls offline
and then attach the debugger to the existing process. Here's the launch.json
file:
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "attach",
"name": "Attach by Process ID",
"processId": "${command:PickProcess}"
}
]
}
Set a breakpoint, start offline
and then start debugging. VS Code will ask you to pick a process. Choose the process. It's usually the first one that comes up in the list, but it's the one that has azure-functions-core-tools/bin/worker
in the title.
Going to close this issue for now, feel free to re-open if you have a question specifically related to the plugin itself.
Is it possible to debug node functions when running serverless offline? I have been able to do this with the serverless offline plugin for AWS with these VS code settings:
And npm script
node --inspect ./node_modules/serverless/bin/serverless offline
Digging into the azure-functions-core-tools I found this:
https://github.com/Azure/azure-functions-core-tools/wiki/Enable-Debugging-for-language-workers
I tried modifying this plugin to pass the language-worker parameter but to no avail.