colorette issue stack overflow while author wants to save recursive string replace
Bug report
You should pin version of colorette or just remove it from dependencies
Because latest version cause stack overflow in some cases cause of recursive implementation.
https://github.com/jorgebucaran/colorette/issues/106
Actual Behavior
On the end of build during output stats
/.../node_modules/colorette/index.cjs:49 const replaceClose = ( ^ RangeError: Maximum call stack size exceeded at replaceClose (/.../node_modules/colorette/index.cjs:49:22) ... at replaceClose (/.../node_modules/colorette/index.cjs:57:32)
Expected Behavior
Should work at any size of output statistics
How Do We Reproduce?
Seems it caused by huge amount of output warnings
Please paste the results of npx webpack-cli info here, and mention other relevant information
System: OS: Windows 11 10.0.27774 CPU: (6) x64 Intel(R) Core(TM) i5-9400F CPU @ 2.90GHz Memory: 12.87 GB / 31.93 GB Binaries: Node: 23.9.0 - D:\data\nodejs\node.EXE npm: 10.9.2 - D:\data\npm\npm.CMD Browsers: Edge: Chromium (133.0.3065.69) Packages: copy-webpack-plugin: 12.0.2 => 12.0.2 css-minimizer-webpack-plugin: 7.0.0 => 7.0.0 exports-loader: 5.0.0 => 5.0.0 expose-loader: 5.0.0 => 5.0.0 imports-loader: 5.0.0 => 5.0.0 ngx-uploader: 17.0.1 => 17.0.1 null-loader: 4.0.1 => 4.0.1 postcss-loader: 8.1.1 => 8.1.1 sass-loader: 16.0.4 => 16.0.4 style-loader: 4.0.0 => 4.0.0 ts-loader: 9.5.2 => 9.5.2 val-loader: 6.0.0 => 6.0.0 webpack: 5.97.1 => 5.97.1 webpack-bundle-analyzer: 4.10.2 => 4.10.2 webpack-cli: 6.0.1 => 6.0.1 webpack-stats-plugin: 1.1.3 => 1.1.3 worker-loader: 3.0.8 => 3.0.8
@jorgebucaran Can we fix it on colorette side? https://github.com/jorgebucaran/colorette/pull/107 A lot of developer use this package and many of them can get them, we can't just remove this dependency without a lot of work
@Delagen Sorry we can't do it without extra pain for a lot of versions, we need to fix it on colorette side
More old issue https://github.com/jorgebucaran/colorette/issues/104 for provement, that not only my issue
As for workaround pinned manually
{
"overrides": {
"colorette": "2.0.13"
}
}
Thanks for sharing! I can see it's not ideal, but at least it helps those who need to work around this asap while we sort things out upstream.
@jorgebucaran Can we fix it? Otherwise we will need to looking for another tool or we will move some things into webpack core, thank you
Sure 👌