Amazon Web Services · sdk · fg-0174

DynamoDB DocumentClient throws Unsupported type passed when an item contains a Date or class instance

If you see Error: Unsupported type passed: Tue Oct 14 2026 ... Pass options.convertClassInstanceToMap=true to marshall typeof object as map attribute, the cause and the fix for Amazon Web Services are below, last verified 2026-10-15.

Verified Oct 2026trust 50/100
Symptom
Error: Unsupported type passed: Tue Oct 14 2026 ... Pass options.convertClassInstanceToMap=true to marshall typeof object as map attribute.Writes fail as soon as a createdAt Date object is addedItems built from ORM or class instances fail while plain objects work
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() }, }));
Affected
@aws-sdk/lib-dynamodb and @aws-sdk/util-dynamodb, all v3 releases
Sources

Last verified 2026-10-15 · Confirmed by 0 builders

Related traps

Have your agent know this before it fails

$ /plugin marketplace add getfootgun/footgun
$ /plugin install footgun@footgun