Closed duckbytes closed 2 years ago
I was able to work around the issue for now by downgrading:
yarn add aws-appsync@4.0.0
npm install aws-appsync@4.0.0
did not solve it for me. Same error
Same issue here. Downgrading to 4.0.0 fixed it for me too.
Downgrading to 4.0.0 worked for me too. Thanks!
@chrisbonifacio Any idea what's going on here?
Downgrading to 4.0.0 worked for me too. Thanks!
@chrisbonifacio Any idea what's going on here?
Hey @ffxsam, we've since updated our AppSync docs to recommend using node-fetch
when performing GraphQL mutation from a Lambda and/or Node.js rather than the AppSync SDK. Apologies for the confusion.
https://docs.amplify.aws/lib/graphqlapi/graphql-from-nodejs/q/platform/js/
@chrisbonifacio Perfect, thanks for the heads-up on that!
@chrisbonifacio Thank you for the update. Can you please elaborate what this means for the AWSAppSync JS SDK? We are using AWSAppSyncClient caching capabilities in a few places in our code.
@chrisbonifacio Just in retrospect: since this was a breaking change, shouldn't the version have been bumped to 5.0.0?
This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.
Looking for a help forum? We recommend joining the Amplify Community Discord server amplify-help
forum.
Before opening, please confirm:
JavaScript Framework
React
Amplify APIs
GraphQL API
Amplify Categories
function, api
Environment information
Describe the bug
Attempting to require("aws-appsync") causes this error to return:
Lambda:Unhandled", message: "Cannot convert undefined or null to object"
I'm following the guide and using the example code from here: https://aws.amazon.com/blogs/mobile/supporting-backend-and-internal-processes-with-aws-appsync-multiple-authorization-types/
If I do the same import locally in a node shell, using the same version of aws-appsync the import works fine in node 14 and node 16.
amplify mock function
also fails with the same errorExpected behavior
The Lambda function should run without error.
Reproduction steps
amplify add function
cd amplify/backend/function/plateletAdminAddNewUser/src
yarn add isomorphic-fetch aws-appsync uuid graphql-tag graphql
amplify push
Code Snippet
index.js:
In my GraphQL schema:
In my React app:
Log output
aws-exports.js
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
package.json file: