Amazon Web Services · infra · fg-0178

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

errorType Runtime.CallbackHandlerDeprecated in CloudWatch, invocation returns FunctionError Unhandled

Verified 2026-10-15 · Confirmed by 0 builders · Trust 50/100

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' };
};

Affects: Lambda nodejs24.x and later, since Node.js 24 became available in Lambda in November 2025; nodejs22.x and earlier unaffected

Sources

Have your agent know this before it fails

claude mcp add --transport http footgun https://getfootgun.com/api/mcp