Closed stayingcool closed 2 years ago
I have asked for help in Discord community as well: https://discord.com/channels/705853757799399426/957602716312543262
Hi,
We were unable to reproduce this with newer version of Amplify. Would you be able to just upgrade aws-amplify and the UI package. The version of these packages you have installed are causing duplicates in the dependency tree. For more information you can check this page https://docs.amplify.aws/lib/troubleshooting/upgrading/q/platform/js/#check-for-duplicate-versions
npm i aws-amplify@latest @aws-amplify/ui-react@1.x.x
After upgrading please try to make a request to the API and let us know if the issue persists.
Hi @vyomr13
I did the following:
npm install
npm i aws-amplify@latest @aws-amplify/ui-react@1.x.x
package.json shows that these libraries are upgraded:
Then started the webserver and observed that the issue is fixed.
What baffles me is that this issue just showed up in the production environment all of a sudden. The solution offered is to upgrade two major libraries that warrant testing the entire application thoroughly before we can deploy this into production.
Is there a way to debug this issue and address the root cause without the library upgrade?
We made sure to only bump up the versions that should not create any major breaking changes. We kept the @aws-amplify/ui-react
package at v1 because v2 is a rewrite and there would be a lot of breaking changes. You could do some testing as a workflow just in case but the behavior should not change. The only breaking change between aws-amplify
v3 and v4 is related to React Native. The root cause of the issue is incompatible versions of packages causing duplicates in the dependency tree. This results in multiple instances of the Amplify class and unexpected behavior (usually missing configuration) as a side effect.
@vyomr13 - Ok, I'll take a look at "incompatible versions of packages causing duplicates in the dependency tree"
I upgraded the libraries and the issue is fixed. Thank you for your time and effort.
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
Authentication, REST API, Storage
Amplify Categories
auth, storage, function, api, hosting
Environment information
Describe the bug
AdminQuery is returning an exception "API AdminQueries does not exist"
The REST endpoint is still returning the same error.
Can you provide some hints to resolve this issue?
Expected behavior
The AdminQueries API should return the list of groups for a user.
Reproduction steps
Add the admin query as documented Invoke the above-mentioned function (code provided above) The API fails and the exception gets caught in the catch block and the error shows "API AdminQueries does not exist" I cannot upgrade the version of amplify cli as of now. This is a working setup and is a part of my production setup that suddenly stopped working.
Code Snippet
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