Tim here with the AWS Support Team!
Yes, I too ran into the same issue and was able to recreate this and understand what you’re running into and why this interrupts the debugging workflow.
I was able to do a bit of investigative work on my end, and I believe I traced the origins of this issue. I noticed when I inspected the call stack in Visual Studio Code it said “PAUSED ON DEBUGGER STATEMENT”, however I had set no breakpoint in that index.js file (located at /var/runtime/index.js according to the debugger).
Interesting I thought…so I began to dig around online what this message means, and I stumbled across an article online located here:
Now it appears the fix is to go into your Visual Studio Codes debug configuration and add a “skipFiles” section, and some documentation on that is located here: https://code.visualstudio.com/docs/nodejs/nodejs-debugging#_skipping-uninteresting-code
What thickens the plot a bit, when I went to add this “skipFiles” it said it was not supported, however digging into some GitHub issues, it appears it should be able to be ignored, and indeed I do see that other items are being ignored in the debug stack after I add some other folders to be ignored, so by all accounts its working on some spots: https://github.com/Microsoft/vscode-react-native/issues/620
Now with all that said, I was still not able to get past this specific file being ignored, I regret to inform you.
Still, I hope the information I shared above can help you pick up the investigation further..from all indications it appears to be more of a VS Code item rather than the AWS Toolkit (perhaps even the node.js debugger being at fault), so as the next steps I recommend opening an issue with the Visual Studio Code team and check if that can yield some results: https://github.com/microsoft/vscode
SAM: In function code, import layer node_modulesasked 3 months ago
AWS SAM CLI: Deploy AWS Lambda with least privilege accessasked 6 months ago
cdk synth and sam cliasked 2 months ago
Update Existing Lambda Function using SAM.Accepted Answerasked 4 months ago
Docker Alternatives for SAM CLIasked 5 months ago
How to connect VSCode Node debugger to local SAMasked 9 months ago
When to use AWS CLI versus AWS SAM CLI for Lambda function deploymentasked 3 years ago
SAM CLI Deployment error creating S3 BucketAccepted Answerasked a year ago
SAM CLI- Using "sam build" - Build includes non required foldersasked a month ago
AWS SAM CLI: Continue debugging automatically following start in VS Code?asked 6 months ago