You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i'm creating a rest api based on this guide. The guide only goes as far as setting up API Gateway with a Lambda function (optionally with Cognito), but it does not cover saving data to dynamodb.
Using v3 of the aws-sdk, I am saving to dynamodb using the following imports:
From there, I am using the following method to save an item to the table:
awaitdocClient.send(newPutCommand(params))
While this deploys, I get a cryptic error message:
{
"errorType": "TypeError",
"errorMessage": "(0 , Yse.setFeature) is not a function",
"stack": [
"TypeError: (0 , Yse.setFeature) is not a function",
" at file:///var/task/index.mjs:67:11952",
" at file:///var/task/index.mjs:2:24314",
" at file:///var/task/index.mjs:67:17774",
" at cN.send (file:///var/task/index.mjs:12:9605)",
" at e (file:///var/task/index.mjs:67:24350)",
" at Runtime.Wye [as handler] (file:///var/task/index.mjs:67:24401)",
" at Runtime.handleOnceNonStreaming (file:///var/runtime/index.mjs:1173:29)"
]
}
During debugging, I confirmed it has to do with the PutCommand. I refactored my code to use v2 of the aws-sdk and it worked as expected.
Expected behavior
I expect to be able to use v3 of the aws-sdk on a manually created table when inside of a lambda function.
Reproduction steps
npm create amplify@latest
delete amplify/data folder
Setup a REST API according to the guide mentioned above
Setup a Table using the L2 CDK construct
Grant the function the necessary permissions to access the table
In the function code, use v3 of the aws-sdk to try and perform operations against the table.
Refactor function code to use v2 to observe working code.
Code Snippet
// Put your code below this line.
Log output
// Put your logs below this line
aws-exports.js
No response
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response
The text was updated successfully, but these errors were encountered:
This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.
Before opening, please confirm:
JavaScript Framework
Not applicable
Amplify APIs
Not applicable
Amplify Version
v6
Amplify Categories
storage, function, api
Backend
Amplify Gen 2 (Preview)
Environment information
Describe the bug
i'm creating a rest api based on this guide. The guide only goes as far as setting up API Gateway with a Lambda function (optionally with Cognito), but it does not cover saving data to dynamodb.
Using v3 of the aws-sdk, I am saving to dynamodb using the following imports:
From there, I am using the following method to save an item to the table:
While this deploys, I get a cryptic error message:
During debugging, I confirmed it has to do with the
PutCommand
. I refactored my code to use v2 of the aws-sdk and it worked as expected.Expected behavior
I expect to be able to use v3 of the aws-sdk on a manually created table when inside of a lambda function.
Reproduction steps
amplify/data
folderTable
using the L2 CDK constructCode Snippet
// Put your code below this line.
Log output
aws-exports.js
No response
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response
The text was updated successfully, but these errors were encountered: