Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

680
Visualizações
AuthError - Error: Amplify has not been configured correctly

First I have successfully completed configuring my react application using amplify configure. I did that with the help of AWS Amplify docs. Then I have successfully added authentication to my amplify project, using amplify add auth and amplify push. I followed all the steps in the AWS - Authentication with Amplify Doc

My App.js looks like this,

import React from 'react';
import { withAuthenticator, AmplifySignOut } from '@aws-amplify/ui-react';
import Amplify, { Auth } from 'aws-amplify';
import awsconfig from './aws-exports';

Amplify.configure(awsconfig);


const App = () => (
    <div>
        <AmplifySignOut />
        My App
    </div>
);

export default withAuthenticator(App);

But when I try npm start, it shows the following error, AuthError - Error: Amplify has not been configured correctly.

over 4 years ago · Santiago Trujillo
7 Respostas
Responde à pergunta

0

run amplify update auth

choose Walkthrough all the auth configurations.

enable unauthenticated logins along the walkthrough and leave other settings.

Source: https://docs.amplify.aws/lib/graphqlapi/authz/q/platform/js/#using-amplify-graphql-client

When using AWS_IAM for public API access, unauthenticated logins must be enabled. To enable unauthenticated logins, run amplify update auth from the command line and choose Walkthrough all the auth configurations.

this solved my problem in combination with graphQL API

over 4 years ago · Santiago Trujillo Relatório

0

I was doing todo app in Expo,and faced same issue. I had to add right path for config file. Path is different for aws-exports and it is not mentioned in Docs. My example code is below

import awsconfig from './src/aws-exports'

Amplify.configure(awsconfig);
Auth.configure(awsconfig);

import { createTodo } from './src/graphql/mutations'
import { listTodos } from './src/graphql/queries'
import { withAuthenticator } from 'aws-amplify-react-native'
over 4 years ago · Santiago Trujillo Relatório

0

I am dealing with this error right now without having @aws-amplify/ui-react installed. I believe there were changes made to Auth from version 3 to 4 that is causing the issue

over 4 years ago · Santiago Trujillo Relatório

0

If you are using Yarn, this issue can arise from a package manager conflict based on how they manage the dependency tree and version updates.

If you are seeing this issue repeatedly; In some scenarios you should try using Npm.

If you are using Yarn -You should first delete Yarn.lock and your node_modules directory. npm install

Also, see the answer above too Untamables Answer

over 4 years ago · Santiago Trujillo Relatório

0

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 Module
Auth.configure(awsconfig);
over 4 years ago · Santiago Trujillo Relatório

0

  • npm un aws-amplify @aws-amplify/ui-react
  • npm i aws-amplify @aws-amplify/ui-react

This worked for me. Thanks @Ignacio

over 4 years ago · Santiago Trujillo Relatório

0

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.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda