lambda-warmer icon indicating copy to clipboard operation
lambda-warmer copied to clipboard

TypeError: lambda.invoke(...).promise is not a function

Open aljanson opened this issue 6 years ago • 2 comments

Hello,

I followed the tutorial and added the code (via the callback technique) to my existing lambda function.

I created a test event on the lambda with the following event object: { "warmer":true,"concurrency":3 }

When i executed the test, it failed with the following error traced on Cloudwatch:

TypeError: lambda.invoke(...).promise is not a function
at module.exports (/var/task/node_modules/lambda-warmer/index.js:94:48)

When i changed the concurrecy value to 1, it worked fine and returned "warmer" as the callback message (based on the default tutorial example). And i am assuming this is because we just return a Promise.resolve(true) when the concurrency is 1.

I read about this error in other posts and some people mentioned setting the API version for the SDK. But looking at nobody else had this issue, I am wondering I might have made a very obvious blunder and would appreciate some guidance regarding this.

Thanks!

aljanson avatar Mar 19 '19 21:03 aljanson

Hi @aljanson. What version of the SDK are you using?

jeremydaly avatar Mar 20 '19 13:03 jeremydaly

Hey @jeremydaly

Had a look at the package.json, it shows: "aws-sdk": "2.2.48"

aljanson avatar Mar 20 '19 16:03 aljanson