Closed adi518 closed 2 years ago
@adi518 Thank you for the detailed capture of your environment. I have been troubleshooting a related issue and I suspect the solution will be the same for you.
The aws-amplify-react
appears to cause other amplify packages to lock onto older versions causing this error. I would recommend removing aws-amplify-react
and then reinstalling aws-amplify
.
npm uninstall aws-amplify-react aws-amplify
npm install aws-amplify
If your project depends on some of amplify's react features, prefer upgrading to @aws-amplify/ui-react
over using aws-amplify-react
.
Closing this as we have not heard back from you. If you are still experiencing this issue and in need of assistance, please feel free to comment and provide us with additional information to debug further.
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 *-help
channels or Discussions for those types of questions.
Before opening, please confirm:
JavaScript Framework
React
Amplify APIs
Predictions
Amplify Categories
predictions
Environment information
Describe the bug
When I first added this category, it worked just fine. I then moved between branches and from
amplify mock api
to a real environment and now all I get is the error below. The only way I could make it work again is by going through the hassle of re-cloning and re-initiating Amplify. While debugging this, I found there's a very confusing way to consume thePredictions
class. It can either be imported fromaws-amplify
or from@aws-amplify/predictions
, my IDE autocomplete often picks the wrong import (the one that doesn't appear in the docs) and I suspect the SDK itself gets confused, because if I try to usePredictions
fromaws-amplify
, it stops failing on a missing provider and throws an auth error.Expected behavior
Translate successfully.
Reproduction steps
Add Predictions Move between branches Try to use a Predictions API
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