ant-design / pro-components

🏆 Use Ant Design like a Pro!
https://pro-components.antdigital.dev
MIT License
4.14k stars 1.32k forks source link

🐛[BUG] 循环依赖问题 #7484

Open fnoopv opened 11 months ago

fnoopv commented 11 months ago

提问前先看看:

https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/main/README-zh_CN.md

🐛 bug 描述

使用 vite 打包时产生零循环依赖警告, 警告信息如下:

Export "ProForm" of module "node_modules/.pnpm/@ant-design+pro-form@2.17.2_antd@5.8.2_rc-field-form@1.36.2_react-dom@18.2.0_react@18.2.0/node_modules/@ant-design/pro-form/es/layouts/ProForm/index.js" was reexported through module "node_modules/.pnpm/@ant-design+pro-form@2.17.2_antd@5.8.2_rc-field-form@1.36.2_react-dom@18.2.0_react@18.2.0/node_modules/@ant-design/pro-form/es/layouts/index.js" while both modules are dependencies of each other and will end up in different chunks by current Rollup settings. This scenario is not well supported at the moment as it will produce a circular dependency between chunks and will likely lead to broken execution order.
Either change the import in "src/pages/Task/TaskInfo/components/components/TaskForward.tsx" to point directly to the exporting module or reconfigure "output.manualChunks" to ensure these modules end up in the same chunk.
Export "ProForm" of module "node_modules/.pnpm/@ant-design+pro-form@2.17.2_antd@5.8.2_rc-field-form@1.36.2_react-dom@18.2.0_react@18.2.0/node_modules/@ant-design/pro-form/es/layouts/ProForm/index.js" was reexported through module "node_modules/.pnpm/@ant-design+pro-form@2.17.2_antd@5.8.2_rc-field-form@1.36.2_react-dom@18.2.0_react@18.2.0/node_modules/@ant-design/pro-form/es/layouts/index.js" while both modules are dependencies of each other and will end up in different chunks by current Rollup settings. This scenario is not well supported at the moment as it will produce a circular dependency between chunks and will likely lead to broken execution order.
Either change the import in "node_modules/.pnpm/@ant-design+pro-table@3.10.5_antd@5.8.2_rc-field-form@1.36.2_react-dom@18.2.0_react@18.2.0/node_modules/@ant-design/pro-table/es/utils/cellRenderToFromItem.js" to point directly to the exporting module or reconfigure "output.manualChunks" to ensure these modules end up in the same chunk.
Export "useEditableArray" of module "node_modules/.pnpm/@ant-design+pro-utils@2.12.9_antd@5.8.2_react-dom@18.2.0_react@18.2.0/node_modules/@ant-design/pro-utils/es/useEditableArray/index.js" was reexported through module "node_modules/.pnpm/@ant-design+pro-utils@2.12.9_antd@5.8.2_react-dom@18.2.0_react@18.2.0/node_modules/@ant-design/pro-utils/es/index.js" while both modules are dependencies of each other and will end up in different chunks by current Rollup settings. This scenario is not well supported at the moment as it will produce a circular dependency between chunks and will likely lead to broken execution order.
Either change the import in "node_modules/.pnpm/@ant-design+pro-table@3.10.5_antd@5.8.2_rc-field-form@1.36.2_react-dom@18.2.0_react@18.2.0/node_modules/@ant-design/pro-table/es/Table.js" to point directly to the exporting module or reconfigure "output.manualChunks" to ensure these modules end up in the same chunk.
Export "recordKeyToString" of module "node_modules/.pnpm/@ant-design+pro-utils@2.12.9_antd@5.8.2_react-dom@18.2.0_react@18.2.0/node_modules/@ant-design/pro-utils/es/useEditableArray/index.js" was reexported through module "node_modules/.pnpm/@ant-design+pro-utils@2.12.9_antd@5.8.2_react-dom@18.2.0_react@18.2.0/node_modules/@ant-design/pro-utils/es/index.js" while both modules are dependencies of each other and will end up in different chunks by current Rollup settings. This scenario is not well supported at the moment as it will produce a circular dependency between chunks and will likely lead to broken execution order.
Either change the import in "node_modules/.pnpm/@ant-design+pro-table@3.10.5_antd@5.8.2_rc-field-form@1.36.2_react-dom@18.2.0_react@18.2.0/node_modules/@ant-design/pro-table/es/Table.js" to point directly to the exporting module or reconfigure "output.manualChunks" to ensure these modules end up in the same chunk.
Export "editableRowByKey" of module "node_modules/.pnpm/@ant-design+pro-utils@2.12.9_antd@5.8.2_react-dom@18.2.0_react@18.2.0/node_modules/@ant-design/pro-utils/es/useEditableArray/index.js" was reexported through module "node_modules/.pnpm/@ant-design+pro-utils@2.12.9_antd@5.8.2_react-dom@18.2.0_react@18.2.0/node_modules/@ant-design/pro-utils/es/index.js" while both modules are dependencies of each other and will end up in different chunks by current Rollup settings. This scenario is not well supported at the moment as it will produce a circular dependency between chunks and will likely lead to broken execution order.
Either change the import in "node_modules/.pnpm/@ant-design+pro-table@3.10.5_antd@5.8.2_rc-field-form@1.36.2_react-dom@18.2.0_react@18.2.0/node_modules/@ant-design/pro-table/es/Table.js" to point directly to the exporting module or reconfigure "output.manualChunks" to ensure these modules end up in the same chunk.
Export "default" of module "node_modules/.pnpm/@ant-design+pro-form@2.17.2_antd@5.8.2_rc-field-form@1.36.2_react-dom@18.2.0_react@18.2.0/node_modules/@ant-design/pro-form/es/components/FormItem/index.js" was reexported through module "node_modules/.pnpm/@ant-design+pro-form@2.17.2_antd@5.8.2_rc-field-form@1.36.2_react-dom@18.2.0_react@18.2.0/node_modules/@ant-design/pro-form/es/components/index.js" while both modules are dependencies of each other and will end up in different chunks by current Rollup settings. This scenario is not well supported at the moment as it will produce a circular dependency between chunks and will likely lead to broken execution order.
Either change the import in "node_modules/.pnpm/@ant-design+pro-form@2.17.2_antd@5.8.2_rc-field-form@1.36.2_react-dom@18.2.0_react@18.2.0/node_modules/@ant-design/pro-form/es/layouts/ProForm/index.js" to point directly to the exporting module or reconfigure "output.manualChunks" to ensure these modules end up in the same chunk.

📷 复现步骤

使用 ProForm 组件

🏞 期望结果

没有循环依赖警告

💻 复现代码

© 版本信息

🚑 其他信息

vite: 4.4.6 antd: 5.8.2 react-dom: 18.2.0

xiaodiao1212 commented 6 months ago
image

me too ! version:

can anybody resolve it ? @fnoopv @andriijas @sorrycc @craxyz @thierryxing

xsjcTony commented 5 months ago

+1, Vite5和所有 antd 依赖是最新的情况下, 依然有这个问题

image

fnoopv commented 5 months ago
image

me too ! version:

  • ProComponents:2.6.43

can anybody resolve it ? @fnoopv @andriijas @sorrycc @craxyz @thierryxing

no

andriijas commented 5 months ago

I have not used this for many years.