Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

util-dynamodb throws "Error: Unsupported type passed: [object Map]" for Map object #2008

Closed
trivikr opened this issue Feb 9, 2021 · 1 comment · Fixed by #2010
Closed
Assignees
Labels
bug This issue is a bug.

Comments

@trivikr
Copy link
Member

trivikr commented Feb 9, 2021

Describe the bug

@aws-sdk/util-dynamodb throws "Error: Unsupported type passed: [object Map]" for Map object

Your environment

SDK version number

@aws-sdk/[email protected]

Is the issue in the browser/Node.js/ReactNative?

All

Details of the browser/Node.js/ReactNative version

N/A

Steps to reproduce

Code
const { marshall } = require("@aws-sdk/util-dynamodb");

(async () => {
  const input = new Map();
  input.set("a", 1);
  input.set("b", 2);

  console.log(JSON.stringify(marshall(input)));
})();

Observed behavior

Running the code throws the following error:

(node:11653) UnhandledPromiseRejectionWarning: Error: Unsupported type passed: [object Map]. Pass options.convertClassInstanceToMap=true to marshall typeof object as map attribute.

On passing convertClassInstanceToMap=true, it returns {}

Expected behavior

util-dynamodb converts JavaScript Map into DynamoDB Attribute Map

Additional context

Noticed while working on #1974

@trivikr trivikr added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Feb 9, 2021
@trivikr trivikr removed the needs-triage This issue or PR still needs to be triaged. label Feb 11, 2021
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant