aws-sdk-js-v3
aws-sdk-js-v3 copied to clipboard
AwsSdkSigV4Signer is not a constructor when instantiating SSMClient
Checkboxes for prior research
- [X] I've gone through Developer Guide and API reference
- [X] I've checked AWS Forums and StackOverflow.
- [X] I've searched for previous similar issues and didn't find any solution.
Describe the bug
When I attempt tp instantiate system params client, I get the error below on lambda nodejs 18
const ssm = new SSMClient({ region: process.env.REGION });
2024-07-12T03:30:31.273Z undefined ERROR Uncaught Exception {"errorType":"TypeError","errorMessage":"HIt.AwsSdkSigV4Signer is not a constructor","stack":["TypeError: HIt.AwsSdkSigV4Signer is not a constructor"," at ZIt (/var/task/index.js:29:10634)"," at mPt (/var/task/index.js:29:11327)"," at new SSMClient (/var/task/index.js:29:39822)"," at /var/task/index.js:37:270790"," at /var/task/index.js:1:263"," at Object.<anonymous> (/var/task/index.js:96:481488)"," at Module._compile (node:internal/modules/cjs/loader:1358:14)"," at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)"," at Module.load (node:internal/modules/cjs/loader:1208:32)"," at Module._load (node:internal/modules/cjs/loader:1024:12)"]}
INIT_REPORT Init Duration: 498.25 ms Phase: init Status: error Error Type: Runtime.Unknown
2024-07-12T03:30:39.166Z undefined ERROR Uncaught Exception {"errorType":"TypeError","errorMessage":"HIt.AwsSdkSigV4Signer is not a constructor","stack":["TypeError: HIt.AwsSdkSigV4Signer is not a constructor"," at ZIt (/var/task/index.js:29:10634)"," at mPt (/var/task/index.js:29:11327)"," at new SSMClient (/var/task/index.js:29:39822)"," at /var/task/index.js:37:270790"," at /var/task/index.js:1:263"," at Object.<anonymous> (/var/task/index.js:96:481488)"," at Module._compile (node:internal/modules/cjs/loader:1358:14)"," at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)"," at Module.load (node:internal/modules/cjs/loader:1208:32)"," at Module._load (node:internal/modules/cjs/loader:1024:12)"]}
INIT_REPORT Init Duration: 830.34 ms Phase: invoke Status: error Error Type: Runtime.Unknown
START RequestId: 71155d93-2c59-4118-a368-ff59763c7962 Version: $LATEST
Unknown application error occurred
Runtime.Unknown
END RequestId: 71155d93-2c59-4118-a368-ff59763c7962
REPORT RequestId: 71155d93-2c59-4118-a368-ff59763c7962 Duration: 831.22 ms Billed Duration: 832 ms Memory Size: 1024 MB Max Memory Used: 114 MB
SDK version number
@aws-sdk/[email protected]
Which JavaScript Runtime is this issue in?
Node.js
Details of the browser/Node.js/ReactNative version
18.20.2
Reproduction Steps
Attempt to call SSMClient on lambda 18.2.0
Observed Behavior
This call fails: const ssm = new SSMClient({ region: process.env.REGION });
Expected Behavior
It should instantiate the SSMClient without errors
Possible Solution
No response
Additional Information/Context
No response
Hi @pdguru81 - thanks for reaching out.
Can you please provide a minimal reproducible code for us to further review this behavior? I wasn't able to reproduce the issue on my end or find any outstanding issue reports.
This issue seems to be caused by a backwards incompatibility of the recent versions of the sdk clients with older version of the @aws-sdk/core. For us, the issue was caused by having a client-sqs with v3.620 in one layer, and then client-sts with v3.470 in another layer, and the client from the first layer tries to call the @aws-sdk/core from the second layer and throws this error.
The root cause to this issue is likely the mismatched dependencies installed. Since we haven't heard back for further details, I'm going to close this issue now. Please feel free to open a new issue if you need further assistance.
This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.
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.