Can you use aws-sdk util-dynamodb unmarshall in Reactjs

0 votes

I have a Dynamodb post request resource that an API Gateway resource calls to query a table. I'm attempting to use Axios within my React app to call the API. The API is functioning and returning the desired data (console log), but when I attempt to use @aws-sdk/util-dynamodb (unmarshall) to convert the API data, I encounter issues. converting the item response into JSON for usage in React.

./node_modules/@aws-sdk/util-dynamodb/dist-es/convertToNative.js 45:14 Module parse failed: Unexpected token (45:14)

Is there a way to use 'unmarshall' within React? Something like this:

    useEffect(() => {
    const getGoal = async () => {
        try {
            const response = await api.get(apiUrl)
            setGoal(unmarshall(response.data.Items))

This works if I use a Lambda service, but I'm try to see if I can reduce my code.

Jan 3 in AWS by Tejashwini
• 3,470 points
80 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In AWS

+5 votes
2 answers

Can we export/migrate users from AWS cognito, does it cause vendor lock-in?

Cognito actually has the capability to import ...READ MORE

answered Aug 1, 2018 in AWS by bug_seeker
• 15,530 points
3,818 views
0 votes
2 answers
+3 votes
3 answers
0 votes
1 answer

Trying to use GetApiKeys in Amazon SDK

Try using this one:  var client = new ...READ MORE

answered Jun 12, 2018 in AWS by Cloud gunner
• 4,660 points
592 views
0 votes
1 answer

Do you get charged for a security group in AWS EC2?

There is no charge applicable to Security ...READ MORE

answered Jul 18, 2018 in AWS by Priyaj
• 58,100 points
8,740 views
0 votes
1 answer

How can I remove a port from url for node app using nginx

If you run your node server on ...READ MORE

answered Apr 10, 2018 in DevOps on Cloud by ajs3033
• 7,300 points
3,007 views
0 votes
3 answers

ReactJS vs Angular Comparison: Which is better?

One picture, many facts How can you compare ...READ MORE

answered Aug 11, 2018 in Events & Trending Topics by slayer
• 29,330 points
614 views
+2 votes
4 answers
0 votes
1 answer

Amazon DynamoDB: warning

Yes, you should address this problem. You can ...READ MORE

answered Aug 30, 2018 in AWS by Priyaj
• 58,100 points
243 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP