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
{{ message }}
Repository navigation
Error parcing large file with only one row(40Mb json file) #43
When I try to do it from cli Error: File 'messages.json' does not exist When I try to do it from node
directory/node_modules/prettyjson/lib/prettyjson.js:167
output.push.apply(
^
RangeError: Maximum call stack size exceeded
at directory/prettyjson/lib/prettyjson.js:167:19
at Array.forEach (<anonymous>)
at renderToArray (directory/node_modules/prettyjson/lib/prettyjson.js:145:36)
at Object.render (directory/node_modules/prettyjson/lib/prettyjson.js:210:10)
at Object.<anonymous> (directory/test.js:14:24)
at Module._compile (module.js:573:30)
at Object.Module._extensions..js (module.js:584:10)
at Module.load (module.js:507:32)
at tryModuleLoad (module.js:470:12)
at Function.Module._load (module.js:462:3)
it('should not trigger maximum call stack size exceeded error',function(){constsubject={data: []};letindex=1000000;while(index--){subject.data.push(index);}prettyjson.render(subject);});
The solution would be to rewrite renderToArray to use a loop instead of recursion.
Activity
gajus commentedon Jul 18, 2018
Here is a test case to reproduce the issue:
The solution would be to rewrite
renderToArrayto use a loop instead of recursion.gajus commentedon Mar 1, 2019
@rafeca Any chance of fixing this issue?