plotly / plotly/dash

Maximum call stack size exceeded when using dash_table.DataTable with flex

Open
#1,775 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug dash-data-table P3
Dominant language
Python
Stars
24.4k
Forks
2.3k
Avg merge
2d 7h
Merged PRs (30d)
13

Description

Environment

dash                 2.0.0
dash-core-components 2.0.0
dash-html-components 2.0.0
dash-table           5.0.0
- OS: Ubuntu 20.04
- Browser: Chrome
- Version 93

Describe the bug

I have a dash page with a dash_table.DataTable component. The layout looks like this

html.Div style={display='flex'}
  html.Div style={flex=2}
    dash_table.DataTable
  html.Div style={flex=1}
    "some other content"

When I load the webpage, the browser hangs. Here is the stacktrace in JS:

error.js:38 RangeError: Maximum call stack size exceeded
    at RegExp.[Symbol.replace] (<anonymous>)
    at String.replace (<anonymous>)
    at lx.trim (polyfill@7.v2_0_0m1632404132.12.1.min.js:1)
    at parseInt (polyfill@7.v2_0_0m1632404132.12.1.min.js:1)
    at s.handleResize (index.tsx:292)
    at s.handleResize (index.tsx:298)
    at s.handleResize (index.tsx:298)
    at s.handleResize (index.tsx:298)
    at s.handleResize (index.tsx:298)
    at s.handleResize (index.tsx:298)

It only happens when number of rows in page is small and table height does not exceed the 100vh. If number of rows are big, then there is no issue.

I am trying to replicate this with a minimal example. Will update here later.

Expected behavior

Above error should not happen.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the DataTable resize handler shown at index.tsx lines 292 and 298, then reproduce the reported flex layout with a small number of rows in Chrome. Compare the resize behavior when the table exceeds 100vh and when it does not. Done means the minimal layout loads without the reported RangeError or browser hang.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, react, typescript
Domain
data-visualization, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.