[Bug] Cannot read properties of undefined (reading 'group') in blurSeries during React re-render
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 1/5
- Tiempo estimado
- Menos de una hora
- Aptitud para principiantes
- 55/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Tranquilo
- Stack tecnológico
- next.js, react, typescript
- Área
- data-visualization, frontend
Línea de trabajo
Comienza en src/util/states.ts, en blurSeries, y compara su acceso a view con el acceso protegido de toggleSeriesBlurState. Reproduce la secuencia de re-renderizado de React y mouseover, y luego verifica que se omita la vista de una serie eliminada sin un TypeError.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Version
6.0.0
Link to Minimal Reproduction
N/A — race condition during React component re-render
Steps to Reproduce
- Render an ECharts chart (Sankey, Bar, Treemap) inside a React component
- Use
notMerge: truewithecharts-for-react - Trigger a data change that causes React to re-render the chart (e.g., toggling filter buttons)
- While the chart is re-rendering, move the mouse over the chart area
Current Behavior
Runtime TypeError:
Cannot read properties of undefined (reading 'group')
Stack trace:
blurSeries (echarts/lib/util/states.js:362)
→ var view = api.getViewOfSeriesModel(seriesModel);
→ view.group.traverse(...) // 💥 view is undefined
handleGlobalMouseOverForHighDown (states.js:499)
Handler.<anonymous> (echarts.js:1549)
Eventful.trigger (zrender/Eventful.js:103)
Handler.dispatchToElement (zrender/Handler.js:148)
Handler.mousemove (zrender/Handler.js:101)
HandlerDomProxy.mousemove (zrender/HandlerProxy.js:90)
HTMLDivElement.<anonymous> (zrender/HandlerProxy.js:209)
Expected Behavior
No crash. The blur effect should be skipped gracefully when the series view has been disposed.
Root Cause
In blurSeries() (src/util/states.ts), api.getViewOfSeriesModel(seriesModel) can return undefined when a series model still exists in the GlobalModel but its view has been disposed during a React re-render cycle (via setOption with notMerge or component unmount). The code unconditionally accesses view.group:
const view = api.getViewOfSeriesModel(seriesModel);
view.group.traverse(function (child) { // ← crashes if view is undefined
This is the same class of bug as #9402 and #21535 — stale references to disposed series during mouse events.
Suggested Fix
Add a null guard after the view lookup:
const view = api.getViewOfSeriesModel(seriesModel);
if (!view || !view.group) {
return;
}
view.group.traverse(function (child) {
This follows the same pattern used elsewhere in the codebase (e.g., toggleSeriesBlurState already guards view access).
I will submit a PR with this fix.
Environment
| Item | Value |
|---|---|
| OS | macOS |
| Browser | Chrome |
| Framework | React 19 + Next.js 16 |
| echarts-for-react | 3.0.6 |
- Lenguaje dominante
- TypeScript
- Estrellas
- 67.7k
- Forks
- 19.9k
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de apache/echarts
-
[Bug] String formatter templates only replace the first occurrence of `{a}`/`{b}`/`{c}`Posiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertoen pending
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
-
[Bug] Inverse axis collapses the grid with outerBoundsContain when a tick is near the axis edgePosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertoen pending
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
-
en pending
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
en pending
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
[Bug] The zoom cursor in the toolbox area is incorrectPosiblemente ocupada @waterWang la tomó hace 98 días. Abiertobug en pending
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Todos los issues de apache/echarts
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
pollen-robotics/reachy-mini-desktop-app#341 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
mike-north/AgentMonitors#648 ·
Los mantenedores suelen responder en 1 día
-
Position: a popup placed again from between two layout steps lands a fraction of a pixel offAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
vercel-labs/ui#700 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 2 días