ant-design / pro-components

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

🐛[BUG]provider 从 antd 引入 theme 时报错 #5892

Closed SoraYama closed 2 years ago

SoraYama commented 2 years ago

提问前先看看:

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

🐛 bug 描述

[vite] error while updating dependencies: Error: Build failed with 2 errors: nodemodules/@ant-design_pro-provider@2.0.3@@ant-design/pro-provider/es/index.js:5:9: ERROR: No matching export in "node_modules/_antd@4.23.0@antd/es/index.js" for import "theme" nodemodules/@ant-design_pro-utils@2.0.3@@ant-design/pro-utils/es/useStyle/index.js:4:9: ERROR: No matching export in "node_modules/_antd@4.23.0@antd/es/index.js" for import "theme" at failureErrorWithLog (/Users/kongshan/Projects/metis/node_modules/_esbuild@0.14.54@esbuild/lib/main.js:1624:15) at /Users/kongshan/Projects/metis/node_modules/_esbuild@0.14.54@esbuild/lib/main.js:1266:28 at runOnEndCallbacks (/Users/kongshan/Projects/metis/node_modules/_esbuild@0.14.54@esbuild/lib/main.js:1046:63) at buildResponseToResult (/Users/kongshan/Projects/metis/node_modules/_esbuild@0.14.54@esbuild/lib/main.js:1264:7) at /Users/kongshan/Projects/metis/node_modules/_esbuild@0.14.54@esbuild/lib/main.js:1377:14 at /Users/kongshan/Projects/metis/node_modules/_esbuild@0.14.54@esbuild/lib/main.js:678:9 at handleIncomingPacket (/Users/kongshan/Projects/metis/node_modules/_esbuild@0.14.54@esbuild/lib/main.js:775:9) at Socket.readFromStdout (/Users/kongshan/Projects/metis/node_modules/_esbuild@0.14.54@esbuild/lib/main.js:644:7) at Socket.emit (node:events:527:28) at addChunk (node:internal/streams/readable:315:12)

📷 复现步骤

antd@4.23.0 @ant-design/pro-provider@2.0.3

npm run start 即可在 console 看到

🏞 期望结果

无报错

💻 复现代码

https://github.com/ant-design/pro-components/commit/77703c82140d46c4fb9ad82e77d561d313e0436e#diff-43381bb617118dda50bdac37cded65c1a5607dfa6d34323658095bc0f3e51a6dR2

此处引入的 theme 在最新的 antd 中没有导出

© 版本信息

🚑 其他信息

SoraYama commented 2 years ago

找到了相关issue,先关了 https://github.com/ant-design/ant-design-pro/issues/10212