[Bug] TypeError in getDataParams when getData() returns null on disposed series
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 42/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- typescript
- Domain
- data-visualization
Research direction
Start by reading DataFormatMixin.getDataParams() in dataFormat.ts and the getDataParams() overrides in TreemapSeries.ts, SunburstSeries.ts, TreeSeries.ts, PieSeries.ts, FunnelSeries.ts, and ChordSeries.ts. Trace the event path from echarts.ts:778 and the callers in TooltipView.ts:385, 458, then reproduce disposal during interaction. Done means stale mouse events across the listed chart types are ignored without TypeErrors.
Written by the indexing model from the issue text.
Description
Version
6.0.0 (bug present since at least 4.1.0)
Link to Minimal Reproduction
N/A — occurs in any framework (React, Vue, Angular) where chart components unmount during user interaction.
Steps to Reproduce
- Render any chart (sankey, treemap, pie, line) with mouse event handlers
- Navigate away (unmount the component) or call
setOptionwith replacement data while the mouse cursor is over the chart - A stale
mousemove/mouseoutevent fires afterdispose()clears the series data
Current Behavior
TypeError crashes:
Cannot read properties of undefined (reading 'getRawIndex')— fromDataFormatMixin.getDataParams()base methodCannot read properties of undefined (reading 'tree')— fromTreemapSeriesModel.getDataParams()override- Similar crashes possible in pie (
.each), funnel (.mapDimension), sunburst/tree (.tree), chord (.getName)
Stack trace (Sankey example):
DataFormatMixin.getDataParams (dataFormat.ts)
SankeySeriesModel.getDataParams (SankeySeries.ts)
<anonymous> (echarts.ts:778) — findEventDispatcher callback
ECharts.handler → Handler.mousemove → HandlerDomProxy.mousemove
Stack trace (Treemap example):
TreemapSeriesModel.getDataParams (TreemapSeries.ts:126)
<anonymous> (echarts.ts:778)
findEventDispatcher → ECharts.handler → Handler.mousemove
Expected Behavior
Mouse events on disposed chart elements should be silently ignored, not throw TypeErrors.
Root Cause
SeriesModel.getData() can return null/undefined when a series is not alive. The comment in Series.ts explicitly acknowledges this:
// When series is not alive (that may happen when click toolbox
// restore or setOption with not merge mode), series data may
// be still need to judge animation or something when graphic
// elements want to know whether fade out.
return inner(this).data; // ← can be undefined
But getDataParams() and its 6 chart-specific overrides unconditionally access properties on the result. The event handler at echarts.ts calls getDataParams() on mouse events, which can fire on stale DOM elements after the series is disposed.
13+ vulnerable call sites identified:
dataFormat.ts— basegetDataParams()callsdata.getRawIndex(),data.getName(), etc.echarts.ts:778— event handler callsgetDataParams()on potentially dead seriesTreemapSeries.ts,SunburstSeries.ts,TreeSeries.ts— override accessesdata.treePieSeries.ts— override accessesdata.each(),data.mapDimension()FunnelSeries.ts— override accessesdata.mapDimension(),data.getSum()ChordSeries.ts— override accessesdata.getName(),this.getGraph()TooltipView.ts:385, 458— unguarded callers
Affects all chart types and all frameworks where component lifecycle causes chart disposal during user interaction.
Related Issues
- #9402 — Original report (pie chart, closed 2018 as "cannot-reproduce" but never fixed)
- #16998 — Same error on stacked line chart (open)
Environment
- OS: macOS (also reproducible on Linux/Windows)
- Browser: Chrome, Firefox, Safari
- Framework: React 19 + Next.js 16 (but framework-agnostic)
- Dominant language
- TypeScript
- Stars
- 67.7k
- Forks
- 19.9k
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/echarts
-
[Bug] String formatter templates only replace the first occurrence of `{a}`/`{b}`/`{c}`Possibly taken A pull request linked to this issue is open or already merged. Openen pending
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
-
[Bug] Inverse axis collapses the grid with outerBoundsContain when a tick is near the axis edgePossibly taken A pull request linked to this issue is open or already merged. Openen pending
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
en pending
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
en pending
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
[Bug] The zoom cursor in the toolbox area is incorrectPossibly taken @waterWang claimed this 98 days ago. Openbug en pending
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Similar issues
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 85/100
lingdojo/kana-dojo#34223 · 1 comment · 5 reactions ·
Maintainers usually reply within 1 day
-
bug status: needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
mastra-ai/mastra#30587 · 1 comment ·
Maintainers usually reply within 1 day
-
area:web p2 product:business triage:active type:bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
cuadrao-ai/argus#2228 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
embedpdf/embed-pdf-viewer#1098 ·
Maintainers usually reply within 1 day
-
.Needs Triage .Team/Metabot Priority:P3 Type:Bug
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
metabase/metabase#87252 · 1 comment ·
Maintainers usually reply within 1 day