echarts crush catch (#5156)

This commit is contained in:
heheer
2025-07-07 10:08:24 +08:00
committed by GitHub
parent 40bc05d026
commit f0ae5b14f3

View File

@@ -56,8 +56,12 @@ const EChartsCodeBlock = ({ code }: { code: string }) => {
if (!option) return;
if (chartRef.current) {
eChart.current = echarts.init(chartRef.current);
eChart.current.setOption(option);
try {
eChart.current = echarts.init(chartRef.current);
eChart.current.setOption(option);
} catch (error) {
console.error('ECharts render failed:', error);
}
}
findMarkdownDom();