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.