Amazon Web Services · infra · fg-0178

Lambda function fails with Runtime.CallbackHandlerDeprecated after switching to the Node.js 24 runtime

If you see errorType Runtime.CallbackHandlerDeprecated in CloudWatch, invocation returns FunctionError Unhandled, the cause and the fix for Amazon Web Services are below, last verified 2026-10-15.

Verified Oct 2026trust 50/100
Symptom
errorType Runtime.CallbackHandlerDeprecated in CloudWatch, invocation returns FunctionError UnhandledInit log warning: AWS Lambda plans to remove support for callback-based function handlers starting with Node.js 24Handler written as (event, context, callback) worked on nodejs22.x
Cause
The Node.js 24 runtime dropped the handler form that takes a third callback argument. Older runtimes still accept it, so the break appears only on the runtime upgrade.
Fix
Make the handler async and return the result or throw the error. If the callback parameter is declared but never used, just remove it from the signature.
Apply
// before export const handler = (event, context, callback) => { callback(null, { statusCode: 200, body: 'ok' }); }; // after export const handler = async (event, context) => { return { statusCode: 200, body: 'ok' }; };
Affected
Lambda nodejs24.x and later, since Node.js 24 became available in Lambda in November 2025; nodejs22.x and earlier unaffected
Sources

Last verified 2026-10-15 · Confirmed by 0 builders

Related traps

Have your agent know this before it fails

$ /plugin marketplace add getfootgun/footgun
$ /plugin install footgun@footgun