AuthError - Error: Amplify has not been configured correctly
I found the solution to this problem in this github-issue
The fix was simple. Amplify docs do not tell you to load configs of aws-exports
to Auth module
.
Adding this simple line of code in App.js
, solved the issue for me.
import Amplify, { Auth } from 'aws-amplify';import awsconfig from './aws-exports';Amplify.configure(awsconfig);// >>New - Configuring Auth ModuleAuth.configure(awsconfig);
- npm un aws-amplify @aws-amplify/ui-react
- npm i aws-amplify @aws-amplify/ui-react
This worked for me. Thanks @Ignacio
I think this problem occurs under various Amplify module versions due to inconsistencies between installed Amplify modules.In my cases, reinstalling as the below solved it many times.
npm uninstall --save aws-amplify @aws-amplify/ui-react @aws-amplify/ui-components
npm install --save aws-amplify @aws-amplify/ui-react @aws-amplify/ui-components
There is a case that needs reinstalling @aws-amplify/ui-components if you use it.