ant-design / ant-design-charts

A React Chart Library
https://ant-design-charts.antgroup.com/
MIT License
1.91k stars 361 forks source link

Dependency issue with antd v5.0.0 #1689

Open alenocera opened 1 year ago

alenocera commented 1 year ago

Hello, just found this issue while upgrading my project with the new v5.0.0 released today.

npm ERR! Found: antd@5.0.0 npm ERR! node_modules/antd npm ERR! antd@"^5.0.0" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer antd@"^4.6.3" from @ant-design/charts@1.4.2 npm ERR! node_modules/@ant-design/charts npm ERR! @ant-design/charts@"^1.4.2" 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.

As suggests by NPM, we can able to continue installation with --legacy-peer-deps

but I guess a fix is necessary to able to do not have strange issue and strange behaviour at all.

Thanks, appreciate it.

lxfu1 commented 1 year ago

It will be supported in the near future. If the flowchart is not used, you can use sub packages to pass it first,like: @ant-design/plots @ant-design/graphs.

b5414 commented 1 year ago

Same

~fixed: npm install @ant-design/plots

niranjanborawake commented 1 year ago

Hello Team

@ant-design/charts v1.4.2 still has the issue in compilation.

Failed to compile.

./node_modules/@ant-design/charts/node_modules/@antv/x6-react-components/es/color-picker/index.js
Module not found: Can't resolve 'antd/es/popover/style/index.css' in '<repo>/node_modules/@ant-design/charts/node_modules/@antv/x6-react-components/es/color-picker'
osabros commented 1 year ago

Same

So far I'm using it with antd5 and all works

The main breaking changes in antd5 is the changing of Moment library to Dayjs, could this impact the charts library?

niranjanborawake commented 1 year ago

The main breaking changes in antd5 is the changing of Moment library to Dayjs, could this impact the charts library?

Along with this, antd v5 has removed less and adopted CSS-in-JS. charts package has a peer dependency on antd v4 and one of the component ColorPicker directly imports the popover index.css.

When switched to antd v5 there are no css files and hence it fails to compile.

letrape commented 1 year ago

Hello Team

@ant-design/charts v1.4.2 still has the issue in compilation.

Failed to compile.

./node_modules/@ant-design/charts/node_modules/@antv/x6-react-components/es/color-picker/index.js
Module not found: Can't resolve 'antd/es/popover/style/index.css' in '<repo>/node_modules/@ant-design/charts/node_modules/@antv/x6-react-components/es/color-picker'

I have the same issue, any work around to use antd charts with antd 5, i dont want to downgrade to 4.6

Orkuml commented 1 year ago

I'm waiting about solution too. =(

image

alenocera commented 1 year ago

Guys, as you know the command --legacy-peer-deps is not the best solution and if you want to allow compile without using that one, you can use the "overrides" object into your package, like this:

"overrides": {
    "@ant-design/charts": {
      "antd": "^5.0.7"
    }
  },

Obviously also this solution is not the better one, but avoid you to use the legacy command. Meantime something moves forward to fix this, I'm able to compile a little bit better (and faster) instead using the legacy things.

Hope help you and waiting for final solution.

RosaErick commented 1 year ago

Waiting a solution since last year. 😭

image

d00rsfan commented 1 year ago

Guys, as you know the command --legacy-peer-deps is not the best solution and if you want to allow compile > `` "overrides": { "@ant-design/charts": { "antd": "^5.0.7" } }, I also needed to add to "overrides" this line: "@ant-design/icons@": "^5.0.0"`

ildfreelancer commented 1 year ago

For those who got this issue,

While waiting for new upgrade, you can do like this

put this in package.json, you might need to change version to match your current packages

  "overrides": {
    "@ant-design/charts": {
      "antd": "^5.3.1",
      "@ant-design/icons": "^5.0.0"
    }
  }
vgs18 commented 1 year ago

Hi, I am also facing the mentioned issue, any leads on when this will be fixed by ant charts team? The workaround might give a temporary fix, but what is the expected date of permanent resolution? Thanks in advance.

arifszn commented 1 year ago

No update still :(

hassssan051 commented 1 year ago

The library looks great, would love to see an update to v5 so that I can start using it.

Orkuml commented 1 year ago

Almost 5 months passed away since my last try, antD is now in the version 5.4.2, nobody fixed this yet! Everyone needs to use antD Charts can't use antD 5.4.2, seriously?

jdlms commented 1 year ago

Like others here I also fixed this issue by removing the charts package and npm installing @ant-design/plots

gujiwuqing commented 1 year ago

嗨,我也面临着提到的问题,蚂蚁图表团队何时会解决这个问题的任何线索?解决方法可能会提供临时修复,但永久解决的预期日期是什么时候?提前谢谢。

着实有点离谱 我看这个issues已经大半年了 还没解决

zhengmenghuang commented 1 year ago

双手挠头

lxfu1 commented 1 year ago

It will be supported in the near future. If the flowchart is not used, you can use sub packages to pass it first,like: @ant-design/plots @ant-design/graphs.

没有使用到流程图的项目,不会存在antd版本问题,直接安装对应的子包即可,官网示例已经明确指出了对应子包,不需要安装主包@ant-design/charts

gabuvi7 commented 1 year ago

yes, but it doesn't the way to fix something. I wanna use the line graph and i need the '@ant-design/charts' package. 8 month with the same issue. We are in June and it doesn't seems to be fixed

RosaErick commented 1 year ago

August and no update still :(

kamivisionvaibhav commented 1 year ago

Hi Team, thank you for all the contribution and making this library free and open source but is there any plan/timeline on next update where this package will be compatible with v5?

Ranzeb commented 1 year ago

Please can you fix this issue? It's quite annoying

RusseII commented 1 year ago

I would love for this to be fixed thank you for all of your effort !

ketangupta34 commented 11 months ago

PLEASE FIX THIS, its been a year 🙄

AnandD17 commented 10 months ago

please fix this issue its been more than a year

Tantatorn-dev commented 10 months ago

Any update on this

schidobvu commented 9 months ago

Please fix this, More than a year Now!

lxfu1 commented 9 months ago

If only statistical charts are used, it can be upgraded to V2,We will gradually improve other types of charts(flowchart、graphs and so on)

zhoujian-official commented 9 months ago

这个库还维护吗,这个antd的依赖版本问题一年多了都没修。库不维护的话可以标记一下deprecated,以免还有新项目误用这个无人维护的库

hustcc commented 9 months ago

这个库还维护吗,这个antd的依赖版本问题一年多了都没修。库不维护的话可以标记一下deprecated,以免还有新项目误用这个无人维护的库

这不是已经在升级吗?目前已经把 plot 部分升级了,发布了 2.0 版本,其他的 graph、map 的升级,也需要等待底层升级一起,会逐步发布 2.1、2.2 版本,因为跟随依赖,所以周期会比较长。

如果质疑进度和投入,可以进来一起了解下情况,再看时间是不是太长,是不是没有维护!也期望社区同学能一起进来弄,毕竟是业余之外做开源。

zhoujian-official commented 9 months ago

回复质疑倒挺快的,你看看这个issue,2022年11月18日提的。前一段时间还看见antv团队品牌直播,有空搞这种活动。

业余之外是什么意思,这不是蚂蚁官方维护的项目吗,意思是这不是公司的工作?是靠员工业余在维护吗?不算进你们OKR的?

hustcc commented 9 months ago

回复质疑倒挺快的,你看看这个issue,2022年11月18日提的。前一段时间还看见antv团队品牌直播,有空搞这种活动。

业余之外是什么意思,这不是蚂蚁官方维护的项目吗,意思是这不是公司的工作?是靠员工业余在维护吗?不算进你们OKR的?

回复非质疑也挺快的。是蚂蚁官方维护,写进了 OKR,就能接受无脑质疑吗?

接受就事论事,我已经说明了为什么会那么慢,如果要上升到人生攻击,无脑质疑,没法接受。

zhoujian-official commented 9 months ago

很好,一个大量用户提了1年多的issue叫“无脑质疑”。 写进了OKR的工作叫“业余之外”。 讨论一下这个项目的性质(公司维护or业余维护)叫“人身攻击”

这叫“接受论事就事”

祝商祺。我们切echarts了。

ps:给看到的其他人说一下:楼上先给我点的👎

pps:临时解法,package.json加一下:

"overrides": {
    "@ant-design/charts": {
      "antd": "^5.11.2",
      "@ant-design/icons": "^5.2.6"
    }
  },
hustcc commented 9 months ago

pps:临时解法,package.json加一下:

"overrides": {
    "@ant-design/charts": {
      "antd": "^5.11.2",
      "@ant-design/icons": "^5.2.6"
    }
  },

给解决方案,点赞 👍🏻

libinglong commented 9 months ago

这不是开源项目吗?人家100年不维护又怎么样呢?

seilkhanovk commented 9 months ago

I'm really concerned about the unresolved issue here. It's becoming evident that many are affected, and with the shift towards antd 5.0, I anticipate even more will encounter this problem. Could you please provide some insight into what's causing the delay in resolving this? Are there unseen challenges that we're not aware of? Any information or updates on your plans to tackle this issue would be greatly appreciated. Thank you for your attention to this matter

lxfu1 commented 9 months ago

We only have Flowchart depending on antd. If you don't use this chart, you can choose to install the sub-packages @ant-design/[plots|graphs|maps] to avoid this error. Currently, XFlow 2.0 does not have an official website yet, so there should be some stability issues and it cannot be upgraded in a short period of time. Meanwhile, we are also developing Charts 2.0. We have already completed the upgrade of statistical charts and released version 2.0.3. The next step is to upgrade the relationship chart. Please follow V2 branch for updates.

xsjcTony commented 8 months ago

加油 目前用的antd5 虽然还没用charts 但估计快用到了 💚

MatteoToqua commented 6 months ago

Also facing this issue, would appreciate some news from the team. Thank you!!

WoohooWANG commented 5 months ago

2024年的解决办法,@ant-design/charts 升级到 2.x。

WoohooWANG commented 5 months ago

2024年的解决办法,@ant-design/charts 升级到 2.x。