Skip to content

colorette issue stack overflow while author wants to save recursive string replace #5427

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

Open
Delagen opened this issue Mar 5, 2025 · 6 comments

Comments

@Delagen
Copy link

Delagen commented Mar 5, 2025

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.

jorgebucaran/colorette#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

@alexander-akait
Copy link
Member

@jorgebucaran Can we fix it on colorette side? jorgebucaran/colorette#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

@Delagen
Copy link
Author

Delagen commented Mar 5, 2025

More old issue jorgebucaran/colorette#104 for provement, that not only my issue

@Delagen
Copy link
Author

Delagen commented Mar 5, 2025

As for workaround pinned manually

{
  "overrides": {
      "colorette": "2.0.13"
  }
}

@jorgebucaran
Copy link

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.

@alexander-akait
Copy link
Member

@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

@jorgebucaran
Copy link

Sure 👌

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

No branches or pull requests

3 participants