Error: dynamodb cannot read property 's' of undefined

Answered by Rafal Wilinski
Last updated: October 23rd, 2026
Solution
A TypeError while reading S or s means the object being dereferenced is missing. With DynamoDB, check for an absent Item or attribute and confirm whether the client returns typed DynamoDB JSON or native values.
// Low-level GetItemCommand response: const typedName = rawResponse.Item?.name?.S; // DynamoDBDocumentClient GetCommand response: const nativeName = documentResponse.Item?.name;
These snippets assume each response has already been awaited. The DynamoDB String type descriptor is uppercase S, not lowercase s. Document-client strings have no S wrapper. A Number uses N, so do not assume every attribute is a String.
GetItem omits Item when no record matches. ProjectionExpression can also omit name even when an item exists. Handle expected absence explicitly and validate required attributes. If decoding a stream record, check eventName and the configured view before reading NewImage or OldImage.
Other Common DynamoDB Errors (with Solutions)
- DynamoDB delete fails
- dynamodb property projection cannot be empty
- dynamodb streams missing events
- failed to list tables not authorized dynamodb
- DynamoDB string set may not be empty
- dynamodb cannot read property '0' of undefined
- DynamoDB - The Security Token Included In The Request Is Invalid
- ImportError: No module named boto3 (DynamoDB)
- DynamoDB Errors InvalidSignatureException Signature Expired
- dynamodb is abstract cannot be instantiated
- Dynamodb error 500
- com amazonaws services dynamodbv2 model resourcenotfoundexception
- dynamodb mapper save not persisting
- dynamodb cannot read property 'push' of undefined
- DynamoDB type is not supported
Dynobase is a Professional GUI Client for DynamoDB
Start your 7-day free trial today
Product Features
DynamoDB Tools
- SSH GUI Client
- Chat With Cloud
- MongoDB GUI Client
- AWS Cost Monitoring
- DynamoDB Query Builder
- DynamoDB Code Examples
- DynamoDB Node.js Queries
- DynamoDB JSON Converter
- DynamoDB UUID Generator
- DynamoDB Local Admin GUI
- DynamoDB Pricing Calculator
- DynamoDB Single-Table Design
- Best DynamoDB GUI Clients
- Dynobase vs DynoTable