react-pdf icon indicating copy to clipboard operation
react-pdf copied to clipboard

RangeError: Invalid array length at Array.push (<anonymous>)

Open andremorescocia opened this issue 1 year ago • 18 comments

Describe the bug Updating to Version 4.x results in Error:

RangeError: Invalid array length at Array.push () at y (yoga-wasm-base64-esm.js:1273:1) at 00047d12:0xd3fc at 00047d12:0xb7e at 00047d12:0x9b62 at 00047d12:0xa5a5 at 00047d12:0x5a9c at 00047d12:0x769c at 00047d12:0xc3cf at 00047d12:0x76d7

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

andremorescocia avatar Nov 21 '24 14:11 andremorescocia