You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Cannot find module 'aws-sdk/clients/dynamodb in Node.js 18.x with javascript v3:
Just npm install and usage below modules;
import { DeleteItemCommand, UpdateItemCommand, GetItemCommand, DynamoDBClient } from "@aws-sdk/client-dynamodb";
import { marshall, unmarshall } from "@aws-sdk/util-dynamodb";
import { IoTDataPlaneClient, PublishCommand } from "@aws-sdk/client-iot-data-plane"; // ES Modules import
PS: Copy and paste codes to Lambda function is okay which created directly via AWS website.
No need to install AWS SDK javascript v3 as create Lambda function at AWS website;
Steps to reproduce:
Just npm install and usage above modules;
sam deploy --guided;
API Gateway to trigger Lambda function got this error => Cannot find module 'aws-sdk/clients/dynamodb'.
Observed result:
API Gateway to trigger Lambda function got this error => Cannot find module 'aws-sdk/clients/dynamodb'.
Expected result:
Fix this bug => Cannot find module 'aws-sdk/clients/dynamodb in Node.js 18.x with javascript v3:
No need to install AWS SDK javascript v3 as create Lambda function at AWS website;
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
OS: Windows 10
sam --version: SAM CLI, version 1.101.0
AWS region: ap-northeast-1
# Paste the output of `sam --info` here
{
"version": "1.101.0",
"system": {
"python": "3.11.4",
"os": "Windows-10-10.0.19045-SP0"
},
"additional_dependencies": {
"docker_engine": "20.10.17",
"aws_cdk": "Not available",
"terraform": "Not available"
},
"available_beta_feature_env_vars": [
"SAM_CLI_BETA_FEATURES",
"SAM_CLI_BETA_BUILD_PERFORMANCE",
"SAM_CLI_BETA_TERRAFORM_SUPPORT",
"SAM_CLI_BETA_RUST_CARGO_LAMBDA"
]
} Add --debug flag to command you are running
The text was updated successfully, but these errors were encountered:
Hi there, it seems you are trying to build a TypeScript application and test the code on AWS console. You can run sam build to transpile code from TypeScript to JavaScript and sam deploy to deploy the stack. More information and examples can be found in 1 and 2. Let us know if you still have further questions or issues.
Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.
Description:
Just npm install and usage below modules;
import { DeleteItemCommand, UpdateItemCommand, GetItemCommand, DynamoDBClient } from "@aws-sdk/client-dynamodb";
import { marshall, unmarshall } from "@aws-sdk/util-dynamodb";
import { IoTDataPlaneClient, PublishCommand } from "@aws-sdk/client-iot-data-plane"; // ES Modules import
PS: Copy and paste codes to Lambda function is okay which created directly via AWS website.
Steps to reproduce:
Just npm install and usage above modules;
sam deploy --guided;
API Gateway to trigger Lambda function got this error => Cannot find module 'aws-sdk/clients/dynamodb'.
Observed result:
API Gateway to trigger Lambda function got this error => Cannot find module 'aws-sdk/clients/dynamodb'.
Expected result:
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
sam --version
: SAM CLI, version 1.101.0{
"version": "1.101.0",
"system": {
"python": "3.11.4",
"os": "Windows-10-10.0.19045-SP0"
},
"additional_dependencies": {
"docker_engine": "20.10.17",
"aws_cdk": "Not available",
"terraform": "Not available"
},
"available_beta_feature_env_vars": [
"SAM_CLI_BETA_FEATURES",
"SAM_CLI_BETA_BUILD_PERFORMANCE",
"SAM_CLI_BETA_TERRAFORM_SUPPORT",
"SAM_CLI_BETA_RUST_CARGO_LAMBDA"
]
}
Add --debug flag to command you are running
The text was updated successfully, but these errors were encountered: