Skip to content

Conversation

@xXLeoXxOne
Copy link

Description

Opening CSV files with many rows causes the extension to crash with RangeError: Maximum call stack size exceeded.

Stack trace:

RangeError: Maximum call stack size exceeded
    at CsvEditorController.getEffectiveHeader (CsvEditorProvider.js:691:33)
    at CsvEditorController.updateWebviewContent (CsvEditorProvider.js:528:34)
    at CsvEditorController.resolveCustomTextEditor (CsvEditorProvider.js:66:14)
    ...

Steps to reproduce

  1. Open a file with a very large number of rows (see energy_train.csv)
  2. Observe the error

Root Cause

The extension uses Math.max(...array) spread syntax in multiple locations to calculate the maximum column count.
When the CSV has many rows, spreading the array into Math.max() exceeds JavaScript's call stack limit (~65K arguments).

Fix suggestion

Use a stack-safe approach through using reduce()

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

Successfully merging this pull request may close these issues.

1 participant