- 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