-
Notifications
You must be signed in to change notification settings - Fork 578
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lambda embedded SDK doesn't work alongside bundled node modules #4225
Comments
@paul-uz Please can you provide more details to allow us to reproduce what you are seeing? From our testing (function zip file includes node_modules with moment in it), ESM works:
And CJS works:
|
It's not about ESM or CommonJD, it's about having the local package file and node modules folder. Try running a function that just uses the AWS SDK and nothing else, using the embedded SDK in the lambda. It will work. Now add in moment, and add the package.json (containing only momentjs) and node modules folder to the function. The call using the AWS SDK won't work. |
Hi @paul-uz, this seems to be fixed on lambda side. I just did a test and it worked just fine for me. In any case I feel that this issue was related to lambda itself and not with the SDK. I will resolve this issue for now, but please feel free of opening a new issue if is there anything else that we can help with. Thanks! |
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
SDK v3 is embedded in the Node 18 Lambda image. But it does not work if you have a function with a package file and node_modules folder eg your function uses embedded AWS SDK for a database query, and uses a third party library like MomentJS.
SDK version number
latest
Which JavaScript Runtime is this issue in?
Node.js
Details of the browser/Node.js/ReactNative version
Node 18
Reproduction Steps
Create simple function, using a v3 SDK eg lib-dynamodb. Add a single 3rd party module eg MomentJS.
The function won't be able to load lib-dynamodb.
Remove the MomemtJS usage and just have the Js file in the function, it should now be able to use lib-dynamodb successfully.
Observed Behavior
Canot use the embedded v3 SDK when also using 3rd party modules.
Expected Behavior
Should be able to use embedded SDK and additional modules
Possible Solution
No response
Additional Information/Context
No response
The text was updated successfully, but these errors were encountered: