-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Since updating to 3.3.0, running out of memory #8096
Comments
You’ll need a reproducible repo for this. There are some dependencies upgrade in 3.3.0 and that could have taken more memory usage. |
I also encountered the same problem in the company project. |
me too |
I apologize because this isn't a minimally reproducible repo, but this is my repo having problems: https://github.com/daviseford/aos-reminders Just running I will look into creating a minimal version after work. |
Have you tried removing the existing node_modules, then reinstalling? Maybe also removing the lockfile? Just out of interest. |
Yes to both. |
I had the same error with nodejs v10; upgrading to nodejs v12 fixed the issue for me. |
I am on |
I am on |
Temporary workaround is to set a larger max-old-space-size eg, |
Use @petetnt suggestion is work but it take a lot of build time. |
I experienced this today, however it was from updating from 3.0.1 to 3.2.0. After reverting to 3.0.1 the problem disappeared. I'll attach the generated report.json file. |
Same problem here. I upgraded to react-scripts 3.3.0 and webpack 4.41.2 and I had this memory problem. @petetnt suggestion did not help Disabling sourcemaps generation solved the problem, but you need them when developing ! |
Please see wojtekmaj/react-pdf#498 (comment) - a response to what I think may be the same issue. I am not sure how one fixes this within the context of create-react-app. |
It looks like this issue: babel/babel#10875. That's fixed in https://github.com/babel/babel/releases/tag/v7.7.7. create-react-app should bump the @babel/core dependency. |
Having this same issue since I upgraded react-scripts. Node version v13.1.0. react-scripts 3.3.0. |
The following in
|
@gnmerritt this didn't work for us, anything else you changed? |
I've been able to run app changing npm start script
|
Adding There were (and still are) multiple dependencies to |
- We had a major bug since a while back where we ran out of heap memory when building and/or starting the project. I boiled it down to be caused by a bug in Bable 7.7.4, which itself isn't a dependency, but react-scripts depend on it. The bug is fixed in 7.7.7, but I couldn't easily upgrade the package. We'll have to wait for a new release of react-scripts (>3.3.0) and see if they've bumped Babel to >=7.7.7. - Note that this only happens in bigger projects when the source map is being build. Admin remains unaffected, even tough it's on 3.3.0.
My personal experience with this bug:
Maybe this can help debug the issue. |
I have new react project and I still see this error even after setting max old space size
I am using react-scripts version 4.0.3 and react version 17.0.2 |
In my case, I tried increasing heap memory space to 4 GB but the build is getting very slow(Other solutions like Upgrading babel,CRA,Node didn't work for me). When the build is success with 4GB Heapspace I observed that nearly 8 - 10 chunk files sizes are nearly 1MB. So I analyzed all those chunks using Source map explorer. In all chunks almost same libraries code is included (In my case those are Firebase, Video player, etc which are heavy) So In my assumption when webpack is trying to bundle all these chunks It had to build all those libraries dependency graph in every chunk which in turn causes heap memory space issue. So I used Loadable components to lazy load those libraries. After lazy loading all those libraries all chunks files size is reduced almost by half, And Build is getting success without increasing any heap space and build time also got reduced. After optimization if I keep build in 6vCPU , i7 System it is taking around 3 - 4 minutes and I observed that based on the number of Cores available in the system build time is getting reduced. If I keep build in 2vCPU system it is taking around 20 - 25 mins like that sometimes |
I am getting the same error. Did anyone find any workaround? |
No, but in my case one specific dependency causing the issue. Once I remove it, the issues went away. I know it does not solve the original issue, but a temporary solution |
Yeah.. I have min max_old_space_size set to 16384 and it's STILL failing after 40 minutes. It's ridiculous. Builds in 45 seconds on my workstation. Build on google cloud run, and it's 40 minutes. What gives? |
@tlester see my comment above. max_old_space_size does NOT set the typescript memory size without modifications via craco |
Any update about that? I've already tried increasing max_old_space_size but it didn't worked. |
This happens again with [email protected]. For me it is caused by: |
What worked for me
What didn't work for me
What may have caused this for me
EnvironmentI've only had this problem on my AWS Workspace (Windows 10) and not my Mac. |
+1 I have been getting out of memory errors when running |
Thanks, using LoadableComponents resolved the problem for me. |
For TypeScript folks out there: The Problem: https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/blob/main/README.md#options CRA doesn't send any value for My solution: config-overrides.js
I also disabled source map generations unfortunately.
Hope that will help you people! |
This did it for me. thanks! Do you know why this might work like in my case did? |
My solution based on @AmrAbdulrahman solution:
|
That fixes the issue for me as well and it's the most non-intrusive answer so far because it does not overwrite any of the previously set TS configuration. |
Describe the bug
After upgrading to 3.3.0 and TS 3.7.3 (was previously on 3.2.0 and TS 3.7.2), I am unable to run
yarn start
I receive this error:
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
Reverting to react-scripts v3.2.0 resolves this issue - Typescript being at 3.7.3 or 3.7.2. has no effect, so I've narrowed it to react-scripts.
Did you try recovering your dependencies?
Yes, blew away node_modules and re-ran
yarn
, tried without a lock file, etc. No dice.Environment
Windows 10, VSCode (also occurs on my macbook)
The text was updated successfully, but these errors were encountered: