Closed
Description
Describe the bug
(Write your answer here.)
Hi, I'm trying to upgrade from 3.4.1 to 4.0.0 but I noticed that when I make a change it takes approx 20 seconds to recompile. With 3.4.1 it's just a couple of seconds.
Did you try recovering your dependencies?
I deleted node_modules, yarn.lock, and installed the deps.
Which terms did you search for in User Guide?
(Write your answer here if relevant.)
Slow, compile time, recompile.
Environment
Environment Info:
System:
OS: macOS 10.15.7
CPU: (4) x64 Intel(R) Core(TM) i5-4690 CPU @ 3.50GHz
Binaries:
Node: 14.5.0 - /usr/local/bin/node
Yarn: 1.22.5 - /usr/local/bin/yarn
npm: 6.14.5 - /usr/local/bin/npm
Browsers:
Chrome: 86.0.4240.111
Firefox: 81.0
Safari: 14.0
npmPackages:
react: ^17.0.1 => 17.0.1 (16.14.0)
react-dom: ^17.0.1 => 17.0.1 (16.14.0)
react-scripts: ^4.0.0 => 4.0.0
npmGlobalPackages:
create-react-app: Not Found
Steps to reproduce
(Write your steps here:)
yarn start
- change a file
- observe the time it spends on "Compiling..."
Expected behavior
The recompile time should be almost instantaneous. It also takes a lot of time to start the first time (after yarn start
)
Actual behavior
(Write what happened. Please add screenshots!)
The app takes 20 seconds to recompile.
Reproducible demo
(Paste the link to an example project and exact instructions to reproduce the issue.)
Not available, I think it's related to the size of my app (It's 1012 files)
Activity
vlad-khitev-axon commentedon Oct 24, 2020
I have exactly the same problem. In a big TypeScript project (~1000 files) before upgrading to react-scripts@4 any code changes were applied immediately.
Any combination of
TSC_COMPILE_ON_ERROR
andFAST_REFRESH
env variables doesn't affect the compilation time.balonsom commentedon Oct 24, 2020
I have the same problem, it takes around 20 seconds each time it recompiles. It was not happening on 3.4.1
jjhbw commentedon Oct 24, 2020
Same here, recompiles take several times as long as on 3.4.x
MichaelBurgess commentedon Oct 24, 2020
Same here, I can't viably use 4.0.0 as it stands. Previously I'd get a reload of page in ~2 seconds after changing some code. Now takes ~45 seconds. Initial start time is also about 3-4x slower.
ali-master commentedon Oct 24, 2020
Same here, Is there a way to solve this issue?
FezVrasta commentedon Oct 24, 2020
Is anyone aware of a flag that can be set to make the
yarn start
command log verbose output? I'd like to understand what's the underlying issue but with the existing log there isn't any information available.paul-vd commentedon Oct 24, 2020
Having the same issue here 💤
@FezVrasta not sure you can do that with a flag, but you can use patch-package to remove this line from react-scripts.
Or you could try one of these methods. I don't think the
FORCE_COLOR
works anymore.UPDATE:
I disabled the fast refresh using
FAST_REFRESH=false
I then tried injecting it into the webpack config using customise-cra with customize-cra-react-refresh, this is the method I used before cra v4.
The outcome is the same... 👎
Anyone using a rewired cra that is experiencing this problem?
ali-master commentedon Oct 24, 2020
I have your problem because I've used the react-app-rewired to customize the Create-react-app and I disabled the FAST_REFRESH but I got the same issue and every time I change my code, I have to wait for about 50 seconds to see my changes in the Browser.
jmcpeak commentedon Oct 24, 2020
I believe the problem may be related to
eslint
as my IDE which runseslint
on a file save is slow at this task.werevamp commentedon Oct 24, 2020
@jmcpeak It was my .eslintrc.js file that was making everything slow for me. This may not work for everyone but it worked for me. I ended up commenting out a few libraries from my extends list and now it is much faster:
RubenMateus commentedon Oct 24, 2020
Same happening with a medium size project. Upgraded to v4 and its takes a bit more time to recompile. around 5-6s,
previous was almost instant.
houmark commentedon Oct 25, 2020
I've also experienced slow recompile and the only "solution" which is of course not a solution, is to out-comment libraries/plugins.
87 remaining items