Vlad Morzhanov
Vlad Morzhanov

Reputation: 1298

Build with custom-react-scripts library causes memory leaks

I have a project which works with custom-react-scripts and I faced with memory leaks during development. The application is developed using React, Mobx, Mobx-State-Tree and uses decorators with babel.

When i start development server with command react-scripts start 2-3 node.js instances are started:

enter image description here

And when i'm changing some code in the project custom-react-scripts rebuilds project and more node.js instances appears:

enter image description here

Few moments after that all memory are allocated with node.js instances and my laptop starts freezing.

Does anyone know how to prevent custom-react-scripts to start new nodejs instances and solve this memory leak issue ?

Upvotes: 0

Views: 682

Answers (1)

Alexandr Li
Alexandr Li

Reputation: 46

I guess the problem is hiding in your .env configuration file. I was facing this issue too earlier and these steps helped me:

  1. Remove all semicolons in your .env file.
  2. Turn off webpack dashboard by adding: REACT_APP_WEBPACK_DASHBOARD = false

Look at this screenshot (correct .env config). Hope it will help.

enter image description here

Upvotes: 3

Related Questions