Error: aws.dynamodb.documentclient is not a constructor

Answered by Rafal Wilinski
Last updated: October 23rd, 2026
Solution
DocumentClient is not a constructor usually means the imported value is not the constructor expected by the code. Common causes are incorrect capitalization, mixing SDK v2 and v3 APIs, or a mock that replaced the export.
import { DynamoDBClient } from "@aws-sdk/client-dynamodb";
import { DynamoDBDocumentClient } from "@aws-sdk/lib-dynamodb";
const db = DynamoDBDocumentClient.from(new DynamoDBClient({}));Use the @aws-sdk/client-dynamodb and @aws-sdk/lib-dynamodb dependencies for this v3 code. It does not use AWS.DynamoDB.DocumentClient. In legacy v2 code that name is case-sensitive; aws.dynamodb.documentclient is not equivalent.
Check the actual import and installed package with npm ls. Very old v2 versions may lack DocumentClient, but upgrading to unsupported v2 is not the current migration path. Keep the lockfile and fix the dependency or import deliberately. In tests, verify that a module mock exposes the API your code calls.
See current client setup and AWS documentation.
Other Common DynamoDB Errors (with Solutions)
- DynamoDB Error All Attributes Must Be Indexed
- DynamoDB string set may not be empty
- could not unmarshal the value dynamodb
- DynamoDB Network Error: self signed certificate in chain
- DynamoDB throttling error
- DynamoDB Local NoClassDefFoundError
- DynamoDB Is Unsupported It Cannot Be Instantiated
- DynamoDB batch write is not working
- dynamodb-admin not working
- DynamoDB console unable to delete this item
- an expression attribute name used in the document path is not defined
- dynamodb mapper save not persisting
- DynamoDB - The Security Token Included In The Request Is Invalid
- DynamoDB No Provisioned Throughput specified for the table
- dynamodb could not connect to the endpoint url
Dynobase is a Professional GUI Client for DynamoDB
Start your 7-day free trial today