Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Large files) 73500+ rows: RangeError: Maximum call stack size exceeded #38

Open
kivancguckiran opened this issue Sep 5, 2019 · 7 comments

Comments

@kivancguckiran
Copy link

kivancguckiran commented Sep 5, 2019

Hello,

I'm using the node version with below code:

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

(async () => {
  const rows = await readXlsxFile('2019_07_24.xlsx');

  console.log(rows);
})();

Parsing a ~73500 rowed file, attaching. But XPATH module throws the exception: Maximum call stack size exceeded. File uploaded below.

2019_07_24.xlsx

@catamphetamine
Copy link
Owner

catamphetamine commented Sep 5, 2019

I see.
Indeed, it throws that error.
I won't be fixing it though: perhaps this library is not well-suited for some large Excel files.
This issue will remain open for others to see.

@christiaanwesterbeek
Copy link

christiaanwesterbeek commented Oct 19, 2019

Unfortunately for me it's also causing RangeError: Maximum call stack size exceeded .

I came from https://github.com/daspawn/xlsx-stream-reader that also couldn't handle my 122k rows xlsx file before trying this solution. I will probably try https://github.com/SheetJS/js-xlsx next.

@christiaanwesterbeek
Copy link

@kivancguckiran Did you manage to read the large xlsx file? I would like to know how you did that. Other library maybe?

@christiaanwesterbeek
Copy link

christiaanwesterbeek commented Oct 20, 2019

This post is for anyone trying to read a larger excel sheet. I finally got a solution that was able to read my 122k rows excel sheet using https://github.com/SheetJS/js-xlsx :

const workbook = XLSX.read(microstrategyFile. tempFilePath, { type: 'file' });
const [firstSheetName] = workbook.SheetNames;
const worksheet = workbook.Sheets[firstSheetName];

const rows = XLSX.utils.sheet_to_json(worksheet, {
    raw: true, // Use raw values (true) or formatted strings (false)
    header: 1, // Generate an array of arrays ("2D Array")
});

I must say that the above solution is pretty memory intensive. It drove a hobby dyno on Heroku well beyond the 512mb memory limit just by running the above lines.

@kivancguckiran
Copy link
Author

Hello sorry for the late reply. I've used xlsx library. Where I have used is here.

@bigabdoul
Copy link

This post is for anyone trying to read a larger excel sheet. I finally got a solution that was able to read my 122k rows excel sheet using https://github.com/SheetJS/js-xlsx :

const workbook = XLSX.read(microstrategyFile. tempFilePath, { type: 'file' });
const [firstSheetName] = workbook.SheetNames;
const worksheet = workbook.Sheets[firstSheetName];

const rows = XLSX.utils.sheet_to_json(worksheet, {
    raw: true, // Use raw values (true) or formatted strings (false)
    header: 1, // Generate an array of arrays ("2D Array")
});

I must say that the above solution is pretty memory intensive. It drove a hobby dyno on Heroku well beyond the 512mb memory limit just by running the above lines.

Try this: https://www.npmjs.com/package/fast-xlsx-reader

@catamphetamine catamphetamine changed the title RangeError: Maximum call stack size exceeded (Large files) 73500+ rows: RangeError: Maximum call stack size exceeded Feb 15, 2020
Repository owner deleted a comment from cjosue15 Jun 15, 2021
Repository owner deleted a comment from shubhv1 Jun 15, 2021
@catamphetamine
Copy link
Owner

Latest changes: I've removed xpath in [email protected], so the error shouldn't reappear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants