react-pdf
react-pdf copied to clipboard
RangeError: Invalid array length at Array.push (<anonymous>)
Describe the bug Updating to Version 4.x results in Error:
RangeError: Invalid array length
at Array.push (
The error occurs when generating a PDF with a very large volume of data (array.length > 5000). Even after taking more than 3 minutes, it eventually causes the error.
We tested using manual pagination, such as chunks, by defining the number of items per page, and it worked in a time 10 times faster. However, this solution is not viable because we cannot fix the number of items per page, as each generated PDF contains fields with variable sizes.
Expected behavior It is expected that the error mentioned above does not occur and that the PDF generation has better performance using its native pagination functions.
Desktop (please complete the following information):
- OS: [MacOS, Windows]
- Browser [chrome, safari]
- React-pdf/renderer at anything over 3.4.5