fix: RangeError: Maximum call stack size exceeded error at querying.find when children size is too large#1281
Conversation
|
Interesting issue. Testing this myself, for NodeJS the magic number seem to be 105,193 items that are still spreadable (so the number in this PR is quite a bit too low). I can't find an official reference for this limitation though, as all specs make it seem like the number is infinite. Also, spreading into an array doesn't have the same limitation. |
|
Thank you for checking! Environment:
The input array length max size is 120633 in my env. Not depends on byte size. BTW, node 32bit stack size is half of 64 bit according to https://stackoverflow.com/a/20748130. |
|
Hi @yoshitaka-ogata, I've tackled this by switching to a better querying algo in #1349. I've included your test case, so thanks a lot for opening this PR! |
I encounter the error
RangeError: Maximum call stack size exceededatresult.push(...children);in thequerying.findmethod when the children size is too large.children.slicesolve the above error.