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

392
Visualizações
How can I determine where an error occurred in React?

I am running a simple React app w/ webpack in development mode as follows:

webpack -w --mode development --config ./webpack.config.js

so that my code is not minified. However I get a warning from React as follows:

Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in a useEffect cleanup function. at WEBPACK_DEFAULT_EXPORT (http://localhost:3000/bundle.js:4165:70) at div at WEBPACK_DEFAULT_EXPORT (http://localhost:3000/bundle.js:4120:73)

The links it gives are to actual React library code, but I would like to know the code the developer wrote which caused the warning.

Normally React will pull up the developer's code, but in this case it does not. Is there a way to find this easily?

I believe an error will normally show a stack trace but this is a warning so perhaps it is not possible?

I would like to atleast know the file which is causing the warning.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

I'd recommend using eval-source-map in development - https://webpack.js.org/configuration/devtool/#development

eval-source-map - Each module is executed with eval() and a SourceMap is added as a DataUrl to the eval(). Initially it is slow, but it provides fast rebuild speed and yields real files. Line numbers are correctly mapped since it gets mapped to the original code. It yields the best quality SourceMaps for development.

For production, none/source-map is a good place to start with.

source-map - A full SourceMap is emitted as a separate file. It adds a reference comment to the bundle so development tools know where to find it.

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