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
Platform: Darwin Kernel Version 17.7.0: Thu Jun 21 22:53:14 PDT 2018; root:xnu-4570.71.2~1/RELEASE_X86_64 x86_64
Subsystem: util.inspect
I'm using winston logger which in turn uses util.inspect.
I think the object to inspect is huge thus causing this error. But regardless it shouldn't cause invalid range.
RangeError: Invalid string length
[Node] at Array.join (native)
[Node] at reduceToSingleString (util.js:840:23)
[Node] at formatValue (util.js:586:10)
[Node] at formatProperty (util.js:793:15)
[Node] at util.js:643:12
[Node] at Array.map (native)
[Node] at formatObject (util.js:642:15)
[Node] at formatValue (util.js:582:16)
[Node] at formatProperty (util.js:793:15)
[Node] at util.js:643:12
[Node] at Array.map (native)
[Node] at formatObject (util.js:642:15)
[Node] at formatValue (util.js:582:16)
[Node] at formatProperty (util.js:793:15)
[Node] at util.js:643:12
[Node] at Array.map (native)
[Node] at formatObject (util.js:642:15)
[Node] at formatValue (util.js:582:16)
[Node] at inspect (util.js:197:10)
[Node] at Format.module.exports.format [as transform] (/Users/xx/node_modules/logform/pretty-print.js:14:19)
The text was updated successfully, but these errors were encountered:
This got addressed by automatically limiting the maximum string length to round about 128 MB. When exceeding that limit the object will only be inspected in a minimal fashion instead of this error.
Please note that the current way of detecting this is a heuristic and will not work for a few cases with huge single strings at the end (e.g., so the total is already 100 MB and now a single string is added which alone almost has the maximum string length of ~ 2 ** 30. Here the heuristic will fail and the error will still pop up).
I don't think that there's much more on our side that we can improve here. Please try out newer Node.js versions to make use of the heuristic.
I'm using winston logger which in turn uses util.inspect.
I think the object to inspect is huge thus causing this error. But regardless it shouldn't cause invalid range.
RangeError: Invalid string length
[Node] at Array.join (native)
[Node] at reduceToSingleString (util.js:840:23)
[Node] at formatValue (util.js:586:10)
[Node] at formatProperty (util.js:793:15)
[Node] at util.js:643:12
[Node] at Array.map (native)
[Node] at formatObject (util.js:642:15)
[Node] at formatValue (util.js:582:16)
[Node] at formatProperty (util.js:793:15)
[Node] at util.js:643:12
[Node] at Array.map (native)
[Node] at formatObject (util.js:642:15)
[Node] at formatValue (util.js:582:16)
[Node] at formatProperty (util.js:793:15)
[Node] at util.js:643:12
[Node] at Array.map (native)
[Node] at formatObject (util.js:642:15)
[Node] at formatValue (util.js:582:16)
[Node] at inspect (util.js:197:10)
[Node] at Format.module.exports.format [as transform] (/Users/xx/node_modules/logform/pretty-print.js:14:19)
The text was updated successfully, but these errors were encountered: