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
Server-side pdf generation with nodejs version > 16 fails with the following error:
RangeError [ERR_OUT_OF_RANGE]: The value of "size" is out of range. It must be <= 1GiB. Received 9_007_199_254_740_991
at new NodeError (node:internal/errors:393:5)
at computeNewHighWaterMark (node:internal/streams/readable:368:11)
at Readable.read (node:internal/streams/readable:416:27)
at PDFDocument.<anonymous> (/home/app/.yarn/cache/pdfmake-npm-0.3.0-beta.2-7d513f8c84-58ad2341ec.zip/node_modules/pdfmake/js/OutputDocument.js:37:36)
at PDFDocument.emit (node:events:513:28)
at emitReadable_ (node:internal/streams/readable:590:12)
at process.processTicksAndRejections (node:internal/process/task_queues:81:21) {
code: 'ERR_OUT_OF_RANGE'
}
This error occurs since nodejs version 18 because the implementation for the computation of the high watermark in node streams changed. In nodejs v16 the hight watermark value was overriden with the max allowed value (1GB), In nodejs v18 an error is thrown if the max value is exceeded.
To fix this error the default value in OutputDocument.js bufferSize should be changed from currently 9007199254740991 to 0x40000000 (1GB)
The text was updated successfully, but these errors were encountered:
Server-side pdf generation with nodejs version > 16 fails with the following error:
This error occurs since nodejs version 18 because the implementation for the computation of the high watermark in node streams changed. In nodejs v16 the hight watermark value was overriden with the max allowed value (1GB), In nodejs v18 an error is thrown if the max value is exceeded.
To fix this error the default value in
OutputDocument.js
bufferSize should be changed from currently9007199254740991
to0x40000000
(1GB)The text was updated successfully, but these errors were encountered: