Create-react-app: Slower compile time in CRA 4.0.

Created on 30 Oct 2020  ·  12Comments  ·  Source: facebook/create-react-app

I was wondering if I should write a bug report or not, as this could be by design or side effect with Fast Refresh. But I'll leave this as a question for now.

After I upgraded to CRA version 4.0, I noticed that the compile time has increased quite significantly for me, or at least enough for me to clearly notice it. Before Fast Refresh, my app would compile quicker and refresh almost simultaneously when I saved a code change.

What I've already tried to decrease the compile time after upgrading to 4.0:

  1. Deleted the node_modules folder, yarn.lock and then installed.
  2. Bought a new XPS laptop (upgraded from 7th gen i7 to 10th gen i7 Intel processor). Fresh start, faster laptop, more memory, but still slower compile time.

What could cause it:

  • My app is huge. I have very complex Redux state, hundreds of components, etc.
  • I'm running Windows 10

At the moment I'd prefer disabling Fast Refresh in favour of faster compile time, if this is by design. Again, I'm not sure if this is by design or a side effect because of Fast Refresh, but if you need more information from me, or if you want me to try something out, then please comment!

Thanks!

needs triage

Most helpful comment

This issue has been fixed in 4.0.1.
https://github.com/facebook/create-react-app/releases/tag/v4.0.1

The performance is much, much better now! Thank you! ❤🎉

All 12 comments

Confirming the same issue. I upgraded yesterday and the compilation takes significantly longer.
Actually, it seems that it is stuck somewhere in the beginning for some time before even doing something and then the rest of the build process runs as usual.

Same here, for my relatively big project it went from a average of about 1.3 seconds to 24.8 seconds.

Same problem over here. It takes around 20-40 seconds longer now.

Same. I didn't measure but every change before was almost instant and now takes more than 10 seconds if not close to 30s.

I have the same problem here, even for a small project.

Yes, it is solved in this commit https://github.com/facebook/create-react-app/commit/ceeb6544c54ed5c9e3615c62ed132d68e8ebaba5 and will be ship with the next version.

@thomasleduc when are you planning to create new version ?

Here's a workaround that you can apply for the time being: https://github.com/facebook/create-react-app/issues/9930#issuecomment-719037994

Same here

This issue has been fixed in 4.0.1.
https://github.com/facebook/create-react-app/releases/tag/v4.0.1

The performance is much, much better now! Thank you! ❤🎉

I upgraded to v4.0.1 and yarn start takes 2 minutes with typescript, I disabled eslint but nothing changed, please fix it as soon as possible.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alleroux picture alleroux  ·  3Comments

dualcnhq picture dualcnhq  ·  3Comments

Aranir picture Aranir  ·  3Comments

Evan-GK picture Evan-GK  ·  3Comments

ap13p picture ap13p  ·  3Comments