Common Mistakes While Writing Node JS Function for AWS Lambda

Renjith P
3 min readJan 11, 2020

There are some common mistakes developers make while writing function for AWS Lamda that may cost days to resolve.In this post we are discussing about such issues.

Let’s dig into such time killing issues that developers has to keep in mind while writing Lambda functions in Node JS.

  1. Lambda not exit / timeout

This is a very common issue developers face during development and it may be hard to debug for someone who is beginner in dealing with Lamda or Node JS.

You should make sure any background processes or callbacks in your code are complete before the code exits.

In most cases the issue arise due to callback or background processes. As stated in the AWS documentation, we need to make sure to complete processing all callbacks before our handler exits.

This happens due to the non-blocking of Node JS which power noed js what it is.

The event loop allows Node.js to perform non-blocking I/O operations — despite the fact that Javascript is single-threaded — by offloading operations to the system kernel whenever…

--

--