Amazon Web Services · sdk · fg-0174
DynamoDB DocumentClient throws Unsupported type passed when an item contains a Date or class instance
Error: Unsupported type passed: Tue Oct 14 2026 ... Pass options.convertClassInstanceToMap=true to marshall typeof object as map attribute.
Verified 2026-10-15 · Confirmed by 0 builders · Trust 50/100
Cause
The v3 marshaller only converts plain objects, arrays, sets, and primitives. A Date is a class instance, and DynamoDB has no date type, so the SDK refuses it.
Fix
Convert dates to ISO strings or epoch numbers before writing. Use convertClassInstanceToMap only for your own classes, since it would turn a Date into an empty map.
Apply
await ddb.send(new PutCommand({
TableName,
Item: { ...item, createdAt: item.createdAt.toISOString() },
}));Affects: @aws-sdk/lib-dynamodb and @aws-sdk/util-dynamodb, all v3 releases
Sources
- https://github.com/aws/aws-sdk-js-v3/blob/main/packages-internal/util-dynamodb/src/convertToAttr.ts
- https://github.com/aws/aws-sdk-js-v3/blob/main/lib/lib-dynamodb/README.md
Have your agent know this before it fails
claude mcp add --transport http footgun https://getfootgun.com/api/mcp