前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >ECharts 3D React umi 报错:Component series.surface not exists. Load it first

ECharts 3D React umi 报错:Component series.surface not exists. Load it first

作者头像
德顺
发布2022-04-19 12:15:38
1.2K0
发布2022-04-19 12:15:38
举报
文章被收录于专栏:前端资源前端资源

React 的 Umi项目,在使用 Echarts 3D 时报错:Error: Component series.surface not exists. Load it first.

报错原因

Echarts 3D 还需要依赖 echarts-gl 

解决方法

npm 安装 echarts-gl 依赖:

代码语言:javascript
复制
npm install echarts-gl --save

我安装又报了个错:

代码语言:javascript
复制
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/echarts
npm ERR!   dev [email protected]"^4.9.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer [email protected]"^5.1.2" from [email protected]
npm ERR! node_modules/echarts-gl
npm ERR!   [email protected]"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\Deshun\AppData\Local\npm-cache\eresolve-report.txt for a full report.

是因为新版的 [email protected] 对应最低 Echarts 版本是 5.1.2,我用的是 Echarts 4.9.0 版本,对应的是 1.1.2 版本的 echarts-gl

npm 安装对应版本的 echarts-gl:

代码语言:javascript
复制
npm install [email protected] --save

重新运行项目,问题解决。

未经允许不得转载:w3h5 » ECharts 3D React umi 报错:Component series.surface not exists. Load it first

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 报错原因
  • 解决方法
相关产品与服务
图像处理
图像处理基于腾讯云深度学习等人工智能技术,提供综合性的图像优化处理服务,包括图像质量评估、图像清晰度增强、图像智能裁剪等。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档