Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛[BUG] ProForm type definitions broken after 2.8.3 due to absolute path imports #9017

Open
drizzlesconsin opened this issue Feb 15, 2025 · 0 comments

Comments

@drizzlesconsin
Copy link
Contributor

🐛 Bug 描述

在 @ant-design/pro-components 2.8.3 之后的版本中,ProForm 的类型定义出现问题。这是由于类型导入路径从相对路径改为了绝对路径(使用 src/),导致类型无法被正确解析。

📷 复现步骤

  1. 使用 @ant-design/pro-components > 2.8.3 版本
  2. 在代码中使用 ProForm.Item 或 ProForm.Group
  3. TypeScript 会报错,无法找到相关类型定义

路径:@ant-design/pro-form/es/layouts/ProForm/index.d.ts

// ✅ 2.8.3 之前
var Group: React.FC<import("../..").GroupProps>;
var Item: React.FC<import("../../components").ProFormItemProps>;
s_2025
// 🔴 2.8.3 之后
var Group: React.FC<import("src").GroupProps>;
var Item: React.FC<import("src/components/FormItem").ProFormItemProps>;
image

"typescript": "^5.7.3"

🏞 期望结果

s_2025

💻 复现代码

© 版本信息

  • ProComponents 版本: > 2.8.3
  • Umi 版本 4.4.5
  • TypeScript: 5.7.3

🚑 其他信息

#8965

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant