Closed keithwhor closed 1 month ago
I've found that directly importing /var/runtime/node_modules/@aws-sdk/client-s3/dist-cjs/index.js
seems to work, but I'm not sure why import
resolution doesn't work properly after a layer with node modules is attached?
Hi @keithwhor - thanks for reaching out.
I'm going to verify a few things:
npm install @aws-sdk/client-s3
? Ref: https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/s3/This issue has not received a response in 1 week. If you still think there is a problem, please leave a comment to avoid the issue from automatically closing.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.
Checkboxes for prior research
Describe the bug
When creating a Lambda Function with a Layer containing
nodejs/node_modules
, I can no longer access the@aws-sdk
v3 inside of mynodejs-20.x
functions.SDK version number
Latest in Lambda
Which JavaScript Runtime is this issue in?
Node.js
Details of the browser/Node.js/ReactNative version
20.x
Reproduction Steps
@aws-sdk/client-s3
with a layer containingnodejs/node_modules/
and any number of modulescreateFunction
orupdateFunctionCode
call in Node.js SDKinvoke
-- should encounterCannot find package '@aws-sdk/client-s3'
Observed Behavior
Lambda Function throws error;
Cannot find package '@aws-sdk/client-s3'
Expected Behavior
Lambda function executes as normal
Possible Solution
Unsure; it seems that mounting a layer unmounts the AWS SDK.
Additional Information/Context
No response