react-scripts@2.0 takes forever to build
See original GitHub issueRecently, I upgraded a CRA project to the latest react-scripts v2 release (2.0.0-next.2150693d), and quickly realized that “yarn build” takes hours to build my project. Seems like it hangs at “Creating an optimized production build” for some reasons. That was quite unexpected since the previous version of react-scripts that I used (v1.1.5) could build the project just fine, though production build took a fairly long time (~15min).
FYI, before I was able to build, I had to manually update eslint to version 5.6.0, because react-scripts v2 requires it and a different version of eslint (3.9.1) detected higher up in the tree isn’t compatible with react-scripts@2.0, sorta similar to this known issue. I guess this approach could prevent users from breaking react-scripts initial dev dependency? (link).
Environment
node -v:
v8.12.0npm -v
: v6.4.1yarn -v
: (if you use Yarn): v1.9.4- react-scripts: (if you haven’t ejected): 2.0.0-next.2150693d
- Ubuntu 16.04 LTS
Expected Behavior
yarn build succeeds
Actual Behavior
Get stuck at “Creating an optimized production build…” forever.
Reproducible Demo
Here’s my package.json
Issue Analytics
- State:
- Created 5 years ago
- Comments:20 (11 by maintainers)
Top GitHub Comments
I would definitely remove your rewire then with v2, it might be causing some bad configuration. Please try
GENERATE_SOURCEMAP=false yarn build
with no rewires applied.Unfortunately, we’re not going to be of much help unless if you can share the project with us privately.
Closing since we were not given a reproducing project