-
Notifications
You must be signed in to change notification settings - Fork 19.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] ECharts.resize() ERROR! Cannot read properties of undefined (reading 'type') #16642
Comments
DON'T use |
Can he give a more friendly tip than a confusing one?
|
I didn't run the project code you provided, but it looks similar to those raised by other developers before. Try to remove 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,
}; |
if (count > 10 && coordSys?.type === 'cartesian2d' && sampling) { I think the code here should check if the type is null and give a friendly hint. |
When I replace "reactive" with "shallowReactive" it works fine. |
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. |
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. |
just use |
Version
5.3.1
Link to Minimal Reproduction
https://ant-colony-algorithm-function-test-3w5nc58v4-masx200.vercel.app/
Steps to Reproduce
https://github.com/masx200/ant-colony-algorithm-function-test/blob/7a8371201a35e66da1e9aa18da63857fe03521d6/src/appcom.ts
https://github.com/masx200/ant-colony-algorithm-function-test/blob/0ae8b2ddb0c8777c8a703aa67d57742391587fed/functions/echarts-line.ts
https://github.com/masx200/ant-colony-algorithm-function-test/blob/3276347cea90ac2c9535410e3c7a82328005c1a9/src/createchartofcontainer.ts
https://github.com/masx200/ant-colony-algorithm-function-test/blob/3276347cea90ac2c9535410e3c7a82328005c1a9/functions/createmychart.ts
https://github.com/masx200/ant-colony-algorithm-function-test/blob/3276347cea90ac2c9535410e3c7a82328005c1a9/functions/drawlinechart.ts
https://github.com/masx200/ant-colony-algorithm-function-test/blob/3276347cea90ac2c9535410e3c7a82328005c1a9/src/showanddrawrandomgreedyoftsp.ts#L10
Current Behavior
node_modules/echarts/lib/processor/dataSample.js
Expected Behavior
no errors.
Environment
Any additional comments?
No response
The text was updated successfully, but these errors were encountered: