Debugging NodeJs Lambda Functions Locally With Breakpoints - Diligent Dev

preview_player
Показать описание
In this tutorial, we're going to cover how to debug AWS NodeJs Lambda functions locally with breakpoints. Serverless is one of the hottest terms in programming right now and for good reason. But, one of the biggest issues many developers have is debugging issues with serverless.

Serverless Framework

AWS

In the video, I said I would paste code in the description. Instead, here are links to Bitbucket repositories:

Bitbucket Repo (Mac)

Bitbucket Repo (Windows)

Medium Article

#serverless #asw #lambda #serverlessframework #nodejs #programming #programmer #softwareEngineer #softwareDevelopment.
Рекомендации по теме
Комментарии
Автор

Great Tutorial. I have just started working on NodeJs lambda functions. And it helped me a lot debugging my code locally. Thanks!!

sergioramos
Автор

Hey thank you for a great explanation. Can you please advice on how to do this with events please?

VladimirI-pcsk
Автор

Thanks for your guidance. What does `-s dev` do?

codingexpedition
Автор

Where are the steps for installing serverless on mac? I don't see them in the description.

vighneshganti
Автор

Hi, I have followed your tutorial but when I config the serverless credentials is not working. Please help with that portion and module also not found.

akillchetu
Автор

Excelente video, el debugging ayuda a la ahora de buscar errores muy específicos y no estar imprimiendo console.log en todo el código par ver donde llega el el código y donde no, excelente gracias por compartir!!

RafaelBeltranZ
Автор

great tutorial, I got a question when a pressed debug it starts in the debugging mode like you in the video and after 3 seconds stops and does not show up the api endpoint and I cant not make any request, it finishes without any error something like this in the console
> set SLS_DEBUG=* && node --inspect offline -s dev any comment thanks i appreciate your help

andresm
Автор

Awesome tutorial, thanks for making it.

I am having an issue whereby the tutorial's `debug` script tries to invoke the following path:

"debug": "SET SLS_DEBUG=* && node --inspect \"C:\\Program offline -s dev\""

I had to modify the path so that it pointed to the location of global installs on my machine and to also wrap the path in escaped quotes. When I run it I get the following error:


C:\Program Files\nodejs\npm.cmd run-script debug

> SET SLS_DEBUG=* && node --inspect "C:\Program offline -s dev"

Uncaught Error: Cannot find module 'C:\Program offline -s dev'
Process exited with code 1

...with 100% certainty the path shown exists on my machine.

If I cannot get this to work I am thinking of just having my serverless functions call a JS file and having my debug process hit that file directly, thus bypassing the Lambda function and just hoping that it works. I would love to get this working though so any help is really appreciated.

The only thing I did differently from your tutorial was that I already had Serverless and the offline plugin installed - I had to install them globally to follow your guide.

yellow-stand-uwdn