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

446
Visualizações
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'data')

I'm building out CRUD functionality and create had worked the other day with the same code in the component, but now it is giving an error:

Unhandled Rejection (TypeError): Cannot read properties of undefined (reading 'data')

I'm getting an error with the validations, and not sure if it has to do with props. Here is the code where the error exists:

> 30 |     const errorResponse = err.response.data.errors;
 console.log(errorResponse)
     | ^  31 |     const errorArr = [];
  32 |     for (const key of Object.keys(errorResponse)) {
  33 |         errorArr.push(errorResponse[key].message)```

Is anyone familiar with this issue and knows how to fix it?
about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

You trying to read data of object that doesn't exist.

err.response.data

Try to console.log(err) and console.log(err.response) You will probably see that you have something wrong in your response.

about 4 years ago · Juan Pablo Isaza Relatório

0

The problem may come from the URL that connects the API to the application, for this the data is not retrieved from the database

about 4 years ago · Juan Pablo Isaza 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