You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
picocolors tends to throw maximum stack error when it's used with already colored long string such as error messages coming from dom-testing-library. Here are few known issues in down stream:
$ node repro.mjs
(...dir...)/node_modules/picocolors/picocolors.js:22
let start = string.substring(0, index) + replace
^
RangeError: Maximum call stack size exceeded
at replaceClose ((...dir...)/node_modules/picocolors/picocolors.js:22:21) at replaceClose ((...dir...)/node_modules/picocolors/picocolors.js:25:30)....
It's certainly possible for down stream projects to workaround this. However, I'm wondering if you would consider rewriting recursive replaceClose with iterative implementation so that picocolors would be free from call stack error.
The text was updated successfully, but these errors were encountered:
Due to the recursive implementation of
replaceColors
:picocolors/picocolors.js
Lines 21 to 26 in b626148
picocolors tends to throw maximum stack error when it's used with already colored long string such as error messages coming from dom-testing-library. Here are few known issues in down stream:
And here is a simple reproduction:
https://github.com/hi-ogawa/reproductions/tree/main/picocolors-repalceClose-stackoverflow
It's certainly possible for down stream projects to workaround this. However, I'm wondering if you would consider rewriting recursive
replaceClose
with iterative implementation so that picocolors would be free from call stack error.The text was updated successfully, but these errors were encountered: