How to Debug TypeScript Lambda with Breakpoints in VSCode using SAM

1

Hello,

I'm developing a TypeScript Lambda function and encountering difficulties with the VSCode debugger, specifically regarding breakpoints. I'm looking for a step-by-step guide on how to set up and use debugging for TypeScript Lambda functions using SAM (Serverless Application Model) and VSCode.

Initial Steps Taken:

  • Initialized a TypeScript project using sam init with the following options: 1,3,7, n, n, y (creating a TypeScript project with lambda powertools).

Primary Question: After generating the basic SAM project, what are the necessary steps or modifications required to enable effective debugging with breakpoints in VSCode?

Issues Faced:

  1. With target: template in launch.json: Breakpoints set in TypeScript code are not being hit during Lambda execution, yet the function completes successfully.
  2. With target: code in launch.json: Continuously encountering ImportModuleErrors, regardless of the attempted solutions.

Any insights or detailed instructions on how to resolve these issues would be immensely helpful. Specifically, how should launch.json be configured, and are there any other settings or steps needed to debug TypeScript Lambda functions effectively in this setup?

Thank you for your assistance!

deniz
질문됨 5달 전104회 조회
답변 없음

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠