The Issue
We ran into a situation where an AWS lambda runtime version update appears to be causing issues with our code.
This works (nodejs 18.v24; also .v26 works):
This does not work (nodejs 18.v28):
However, those version numbers do not correspond to actual Node versions that I can find. On the Node site, the latest version of 18 is 18.20.2 (as of this writing).
The Question
How do I find the actual Node version behind the AWS version number so I can compare differences between v.26 and v.28 to try to determine what update might be causing issues with our code?
2
Answers
Not an answer, but I have the same issue. Lambda Node 18 v28 breaks my code, whilst v26 works fine. Lambda auto updated node 18 v26 -> v28, but this should be a minor patch, thus not break stuff.
From Node 18 Github, the latest LTS is 18.20.2, which was released April 10th.
The AWS Node 18 container was updated on the between 17th -> 19th of April. I think there’s a non-zero probablity that Node 18 v28 Lambda is 18.20.2. But why would a security patch break code?
The Lambda runtime version does not correlate to the Node.js minor version, so for example the runtime version "nodejs 18.v24" does not mean it should be using Node.js version 18.24.x, rather it’s the 24th time aws has updated the nodejs18 runtime.
The issue is likely being caused by a dependency, normally a patch version wouldn’t cause an issue like that so it might be a rare issue that’s difficult to find
As a temporary solution it looks you can set the lambda runtime manually and stop it from updating it so you can have some time to find the issue then update the runtime version. There is some information in the aws documentation about this:
I’m assuming your lambda function is currently using the $LATEST version by default, and must be automatically updating the runtime version as well, so these instructions might be what you need
You can get the ARN of the working version from the labda logs you posted with the question
These are documentation pages I found this info from