read-excel-file icon indicating copy to clipboard operation
read-excel-file copied to clipboard

Specific file created with LibreOffice causes 'JavaScript heap out of memory' error

Open sagarjoshi-sct opened this issue 1 year ago • 1 comments

We use this package to read and parse relatively small xlsx files containing user records. For a specific file from a customer, calling readXlsxFile causes the process to crash with the following error -

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory

We know that the file was created (or at least opened and saved) in LibreOffice but are unable to diagnose any issues with it. Reducing the row count has no effect. It is reproducible with the file below containing just a single row. Blank Sheet.xlsx (11.3 KB)

Snippet to reproduce the crash with [email protected] -

const readXlsxFile = require('read-excel-file/node');

const filePath = 'Blank Sheet.xlsx';

readXlsxFile(filePath).then((rows) => {
    console.log('rows: ', JSON.stringify(rows));
}).catch((error) => {
    console.log('error: ', error);
});

sagarjoshi-sct avatar Nov 15 '24 12:11 sagarjoshi-sct

Cool, thx. I won't be looking into the issue though.

catamphetamine avatar Nov 15 '24 13:11 catamphetamine