question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:4
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

16reactions
christiaanwesterbeekcommented, Jun 15, 2021

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.

2reactions
catamphetaminecommented, Jun 17, 2021

Latest changes: I’ve removed xpath in read-excel-file@5.2.0, so the error shouldn’t reappear.

Read more comments on GitHub >

github_iconTop Results From Across the Web

JavaScript RangeError: Maximum Call Stack Size Exceeded
The RangeError: Maximum call stack size exceeded is thrown when a function call is made that exceeds the call stack size. This can...
Read more >
javascript - Maximum call stack size exceeded error
It means that somewhere in your code, you are calling a function which in turn calls another function and so forth, until you...
Read more >
RangeError: Maximum call stack size exceeded - Educative.io
In this shot, we will see how to fix the “RangeError: Maximum call stack size exceeded” error. ... The most common source for...
Read more >
Maximum call stack size exceeded when loading large files
I have a large CSS file that's already bundled with almost 200k lines of CSS. I do this to import it: import './vendor.bundle.css';...
Read more >
JavaScript Error: Maximum Call Stack Size Exceeded
If you see the “Maximum Call Stack Size Exceeded” error, there's likely a problem with a recursive function within your JavaScript code.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found