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

242
Visualizações
React Sentry TypeError: Cannot read properties of undefined (reading 'componentStack')

I am trying to use the ErrorBoundry component of Sentry in my react project so that I can contain the errors reported to sentry just for my React app as it lives on many different websites and I don't want to pick up every JS error on every web page and website.

However, every error that is bubbling up from my react app into the ErrorBoundry produces a very obscure and uninformative error such as TypeError: Cannot read properties of undefined (reading 'componentStack')

The actual error without the ErrorBoundry component should be TypeError: Cannot read properties of undefined (reading '0')

It seems like the componentStack is overriding and preventing any useful reporting as per these two images with the ErrorBoundy disabled and enabled respectively. These images are taken from my dev environment and I am the CRACO version.

ErrorBoundry component added enter image description here

ErrorBoundry component removed enter image description here

Code references.

ReactDOM.render(
    <Sentry.ErrorBoundary fallback={<ErrorFallback />}>
      <ApolloProvider client={client}>
        <App shop={shop} customiserId={customiserId} />
      </ApolloProvider>
    </Sentry.ErrorBoundary>,
    customiser
  );

with a fallback component that looks like

const ErrorFallback = () => {
  return (
    <div>An error has occurred</div>
  )
}
about 4 years ago · Juan Pablo Isaza
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