Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slower compile time in CRA 4.0. #9966

Closed
raRaRa opened this issue Oct 30, 2020 · 16 comments
Closed

Slower compile time in CRA 4.0. #9966

raRaRa opened this issue Oct 30, 2020 · 16 comments

Comments

@raRaRa
Copy link

raRaRa commented Oct 30, 2020

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!

@mathiaswillburger
Copy link

mathiaswillburger commented Oct 30, 2020

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.

@jeggy
Copy link

jeggy commented Oct 31, 2020

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

@RealDrewKlayman
Copy link

RealDrewKlayman commented Oct 31, 2020

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

@gastonmorixe
Copy link

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

@zerodouglas
Copy link

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

@mpeteffi
Copy link

It was resolved here: #9886 (comment)

@thomasleduc
Copy link

thomasleduc commented Nov 1, 2020

Yes, it is solved in this commit ceeb654 and will be ship with the next version.

@mareksuscak
Copy link
Contributor

Here's a workaround that you can apply for the time being: #9930 (comment)

@a-tonchev
Copy link

Same here

@raRaRa
Copy link
Author

raRaRa commented Nov 23, 2020

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! ❤🎉

@raRaRa raRaRa closed this as completed Nov 23, 2020
@amaleky
Copy link

amaleky commented Nov 24, 2020

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.

@dagar07
Copy link

dagar07 commented Nov 26, 2020

@iansu Can you please help, how to set up these things, for fast recompile because as mentioned in the 4.0.1 changes logs this was fixed,

#CRA Team

@hendrickl
Copy link

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.

Same here.. painful, can't get what is happening since I upgrated to v4.0.1

@amaleky
Copy link

amaleky commented Nov 26, 2020

This issue cause when I upgraded @types/react and @types/react-dom and removed "React" import from all components. Compile speed is almost good by import React.

@jwchang0206
Copy link

Try compile with Rust
https://jwchang0206.medium.com/make-create-react-app-faster-with-rust-6c75ffa8fdfd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

15 participants