Open itzdrli opened 1 year ago
not sure what you are trying to accomplish with loadImage since it is not used anywhere... Images could be used as background or symbols - Demo Code
not sure what you are trying to accomplish with loadImage since it is not used anywhere... Images could be used as background or symbols - [Demo Code)
Check the code he provided, he is indeed using symbols. And if the image is not loaded, this error will not appear at all
Even when using the Demo code you provided, this error still occurs in node-canvas.
wth, if you remove img.onload = onload.bind(img);
it will works as intented.
Possible related commit: https://github.com/ecomfe/zrender/commit/c564acd0b0619df9402790f67ae229c1e4ac8d8b
Anyway, the offical documentation are not written correctly. https://echarts.apache.org/handbook/en/how-to/cross-platform/server/#loading-of-images
Version
5.4.3
Link to Minimal Reproduction
https://github.com/itzdrli/example
Steps to Reproduce
Use the code from Here. The code has written by following official document
Current Behavior
Error: C:\Users\xxxx\Desktop\t\node_modules.pnpm\echarts@5.4.3\node_modules\echarts\dist\echarts.js:9083 for (var i = 0; i < cachedImgObj.pending.length; i++) { ^
TypeError: Cannot read properties of undefined (reading 'pending') at imageOnLoad (C:\Users\xxxx\Desktop\t\node_modules.pnpm\echarts@5.4.3\node_modules\echarts\dist\echarts.js:9083:42) at setSource (C:\Users\xxxx\Desktop\t\node_modules.pnpm\canvas@2.11.2\node_modules\canvas\lib\image.js:94:13) at Image.set (C:\Users\xxxx\Desktop\t\node_modules.pnpm\canvas@2.11.2\node_modules\canvas\lib\image.js:40:9) at Object.loadImage (C:\Users\xxxx\Desktop\t\index.js:16:13) at createOrUpdateImage (C:\Users\xxxx\Desktop\t\node_modules.pnpm\echarts@5.4.3\node_modules\echarts\dist\echarts.js:9067:37) at brushImage (C:\Users\xxxx\Desktop\t\node_modules.pnpm\echarts@5.4.3\node_modules\echarts\dist\echarts.js:27311:34) at brush (C:\Users\xxxx\Desktop\t\node_modules.pnpm\echarts@5.4.3\node_modules\echarts\dist\echarts.js:27627:17) at CanvasPainter._doPaintEl (C:\Users\xxxx\Desktop\t\node_modules.pnpm\echarts@5.4.3\node_modules\echarts\dist\echarts.js:40498:17) at repaint (C:\Users\xxxx\Desktop\t\node_modules.pnpm\echarts@5.4.3\node_modules\echarts\dist\echarts.js:40433:31) at _loop_1 (C:\Users\xxxx\Desktop\t\node_modules.pnpm\echarts@5.4.3\node_modules\echarts\dist\echarts.js:40464:21)
Expected Behavior
the image would show
Environment
Any additional comments?
No response