You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
echarts.js:976
Uncaught TypeError: Cannot read properties of undefined (reading 'type')
at Object.reset (dataSample.js:112:34)
at Task2.seriesTaskReset [as _reset] (Scheduler.js:485:70)
at Task2._doReset (task.js:202:23)
at Task2.perform (task.js:117:33)
at Scheduler.js:272:20
at HashMap2.each (util.js:447:20)
at Scheduler.js:255:23
at Array.forEach (<anonymous>)
at each (util.js:205:13)
at Scheduler2._performStageTasks (Scheduler.js:221:5)
changed the title [-][Bug] Cannot read properties of undefined (reading 'type')[/-][+][Bug] ECharts.resize() ERROR! Cannot read properties of undefined (reading 'type')[/+]on Mar 8, 2022
For "echarts", I think when executing the 'resize' function, we should judge whether the type of "this" is "EChartsType", and give a friendly prompt instead of giving an incomprehensible error prompt.
Activity
[-][Bug] Cannot read properties of undefined (reading 'type')[/-][+][Bug] ECharts.resize() ERROR! Cannot read properties of undefined (reading 'type')[/+]plainheart commentedon Mar 9, 2022
DON'T use
reforreactiveto wrap the echarts instance. Use a common variable orshallowRefto avoid the deep watch for echarts instance.masx200 commentedon Mar 9, 2022
Can he give a more friendly tip than a confusing one?
plainheart commentedon Mar 9, 2022
https://github.com/masx200/ant-colony-algorithm-function-test/blob/7a8371201a35e66da1e9aa18da63857fe03521d6/src/appcom.ts#L18-L24
I didn't run the project code you provided, but it looks similar to those raised by other developers before. Try to remove
reactiveor useshallowRef.const chartstore: { best: undefined | ReturnType<typeof createchartofcontainer>; latest: undefined | ReturnType<typeof createchartofcontainer>; -} = reactive({ +} = { best: undefined, latest: undefined, };const chartstore: { best: undefined | ReturnType<typeof createchartofcontainer>; latest: undefined | ReturnType<typeof createchartofcontainer>; -} = reactive({ +} = shallowRef({ best: undefined, latest: undefined, };masx200 commentedon Mar 9, 2022
I think the code here should check if the type is null and give a friendly hint.
masx200 commentedon Mar 9, 2022
When I replace "reactive" with "shallowReactive" it works fine.
plainheart commentedon Mar 9, 2022
This is caused by the third-party library. It has no business with the null check. Please close this issue if you have no further problems. Thanks.
BTW, it's meaningless to make echarts instance reactive.
masx200 commentedon Mar 9, 2022
For "echarts", I think when executing the 'resize' function, we should judge whether the type of "this" is "EChartsType", and give a friendly prompt instead of giving an incomprehensible error prompt.
agne-matheus commentedon Nov 23, 2023
just use
shallowRefinstead ofrefguysxianghongai commentedon Dec 27, 2023
markRaw()
andyesfly commentedon Feb 13, 2025
bug is still bug