gunnargrosch / failure-lambda

Module for fault injection into AWS Lambda
MIT License
94 stars 13 forks source link

Support for Node.js 18.x runtime #48

Open AndresRojasKF opened 1 month ago

AndresRojasKF commented 1 month ago

Hello,

Fan of the project! I was attempting to use this dependency on an ES6, Typescript Lambda and was facing some issues during runtime.

It appears the failure-lambda project uses the V2 of the AWS SDK behind the scenes? There is a suggestion to use V3.

I was seeing this in my test for the main handler:

` Cannot find module 'aws-sdk' from 'node_modules/failure-lambda/lib/failure.js'

241 |   242 | Require stack: 243 | node_modules/failure-lambda/lib/failure.js 244 | src/api/api-handler.ts 245 | spec/api/api-handler.spec.ts

`

And I think the issue was that is that SDK v2 is not included in the runtime as my lambda runtime is nodejs18.x .