-
-
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
[Bug] CircleCI + Terser Error: Call retries were exceeded #8320
Comments
It seems that source: webpack-contrib/terser-webpack-plugin#202 (comment) I had to set explicitly number of cpus for |
Quick update, the workaround for now is setting explicitly https://github.com/webpack-contrib/terser-webpack-plugin#parallel Explanation: webpack-contrib/terser-webpack-plugin#202 (comment) @hernanif1 Maybe you could try and configure terser in a such way: https://auth0.com/blog/how-to-configure-create-react-app/ (from https://create-react-app.dev/docs/alternatives-to-ejecting) |
@hinok craco https://www.npmjs.com/package/@craco/craco is an easier workaround to ejecting, we are currently using it for this issue |
@prithvin excelent suggestion! Do you know if there is something that we could do in our project before implementing your suggestion? |
@hernanif1 my best guess is that suspense (ie code splitting) is the root cause of this. we started seeing failures on CI after code splitting, and on revert, with everything else staying the same, the issue did not show up. the nice part of the workaround is that we are able to continue to use code splitting |
@prithvin Can you share the craco config you used to get this working? Ive tried const TerserPlugin = require('terser-webpack-plugin')
module.exports = {
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
parallel: 1 // and true, and 2
})
]
}
} Which all still fail on circle ci |
@kyeotic this was a hacky approach that worked for us |
@prithvin Wow that was fast, and it worked! You're a life saver |
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs. |
I don't think that this issue should be closed. We're still having to use craco to have insight into the Terser config and parallel setting |
We encountered the same issue on our own GitLab instance, increasing CPU and memory limits of the CI containers solved it. This solution only works if you host the CI by yourself, though. |
Stopping by to note that I experienced this issue when upgrading react from The craco solution is the way to go for this issue at the moment. Thanks to everyone that contributed above, this was doing my head in. |
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs. |
I think that this issue still exists. |
Yeah, this is still and issue for me as it's hapenning also with Bitbucket Pipelines and CRA. |
Having the same issue on circle ci |
Issue opened since January! This needs to be fixed |
Yes, facing the same issue and if now I try to downgrade the version of react-script it gives me below error
|
I was able to get around the
build:
resource_class: large # <--- ADD THIS
working_directory: ~/project The craco workaround posted in the above comments did not work for me. |
Just a note - the Craco solution works well for this issue, but be aware that the config above turns off |
if anyone find this issue by google, please check the memory usage during npm run build |
Is there any update on this? I have tried most of the solutions but nothing is working... |
This also seemed to be a problem in the project I work with.
In the application using this package, which is based on
Using the proposed workaround from @jurosh in the config-overrides.js file in the projects root seems to have solved that problem momentarily. |
There is a new CRA version 4 that solved my issue. I updated the following values on the tsconfig.json compiler options and it worked. |
The following solution posted by @miguelmota solved it for me.
It appears that the error message that points at Terser is a red herring - take a look here: webpack-contrib/terser-webpack-plugin#202 (comment) (TL; DR: terser isn't to blame, a worker proc is running out of memory) Giving my build more memory solved the problem for me. |
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs. |
@stalebot take a holiday mate |
@onilton this worked for me, but what is it doing when |
According to docs, that disables parallel running (it is the same as False): https://github.com/webpack-contrib/terser-webpack-plugin#parallel By default the parallel is calculated based on number of available cpus, but since CircleCi doesn't provide a reliable value for this, this usually explodes memory usage (because the number of instances/parallel is too high). One workaround is to setting this value by hand (and not relying on CircleCi fake cpu count), but for this you need better machines (not the free ones). The other option is disabling parallel. (In my case, I didn't need to have a more expensive machine). It may be a little bit slower but it was cheaper . |
Forcing
If I'm not mistaken this is mainly due to this fix, so any version newer than 2.3.3 would do. (react-scripts@4.0.3 uses webpack@4.44.2 which has a dependency on terser-webpack-plugin@1.4.3.) So to solve this issue, all that has to be changed is to update dependencies. I guess it's tracked in #9994. |
We've upgraded Terser to 4.2.3 in v4. Please try that version and see if it resolves the issue. If not please open a new issue. |
FYI the issue can still be reproduced on very large files. |
Bug
When you use CircleCI to build the project, it will sometimes not compile throwing the error below.
Looks like this is a known problem here: webpack-contrib/terser-webpack-plugin#143 (comment). Recommend setting the webpack configuration based on the feedback.
The text was updated successfully, but these errors were encountered: