create-react-app: react-scripts 4.0.1 is very slow
Describe the bug
react-scripts 4.0.1 is very slow on start and reload, by and without FAST_RELOAD, yarn start takes more than 2 minute now after update.
Did you try recovering your dependencies?
yes
Which terms did you search for in User Guide?
(Write your answer here if relevant.)
Environment
Ubuntu v20.10 Node v12.18.2 LTS yarn v1.22.5
Steps to reproduce
- update react-scripts to v4.0.1
- using typescript
- large scale project
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 40
- Comments: 15 (1 by maintainers)
Commits related to this issue
- Adding fix for slow dev startup. https://github.com/facebook/create-react-app/issues/10145 — committed to manix84/lite_event_checkin by manix84 3 years ago
If you use WSL, you should create a folder in WSL system (e.i.
/home/user/folder
), because/mnt/...
is very slow. If you use remote server check its load with commandhtop
. If it’s ok, your system is slow, upgrade it 😃You just have to create a blank project using
npx create-react-app slow-issues
and start it usingnpm start
.I personally have around 7 seconds of compiling time on a blank project.
Version of CRA
This is indeed a problem @ianschmitz, and I’ve confirmed what @imsandez reported above.
Also, I’ve opened an issue with the
eslint-webpack-plugin
since it’s originating from there.Adding
At the end of
package.json
andyarn
again will fix the issues. It is currently being discussed here: https://github.com/webpack-contrib/eslint-webpack-plugin/issues/52I know this has been there for 2 years, but I followed @eek 's answer and added :
in webpack.config.js of react-scripts package, I also added
react-scripts/eslint-webpack-plugin
:And ran Npm install, I don’t know if that changed anything, but I went from 20+ min to run my app with npm start to ~2-3 min to run it.
Not yet optimal, but that’s way better.
I reinstall node js and it’s good
thank you for the answer, but I noticed that the problem came from my operating system, by the way I was using windows 11, now I am going back to windows 10 and there is no more this problem thank you
Yes
Same for me! Thaks fo the tip! WSL Ubuntu 20.04 on
/mnt/...
@eek Thank you ! As a beginner, I’d specify the package.json file of the react-scripts dependancy in the node modules’ folder (I thought about the package.json file at the root of the project but of course it didn’t work). I followed your instructions:
Went from more than 2mins to start the project to 6s…thank you so much !