Skip to content

feat: upgrade to antd v6 and utoo pack - #11585

Merged
afc163 merged 10 commits into
masterfrom
feat/upgrade-antd-v6
Dec 4, 2025
Merged

afc163 merged 10 commits into
masterfrom
feat/upgrade-antd-v6

Conversation

@afc163

@afc163 afc163 commented Nov 24, 2025 •

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • Chores

    • 升级 Ant Design 到主版本并移除过时兼容补丁,调整相关依赖(含 Umijs 包并新增 lint 包)。
    • 更新项目配置:移除 mako 与 esbuildMinifyIIFE,新增 utoopack,移除 theme.token.cssVar。
    • 升级 CI 用到的 GitHub Actions 版本;更新 .gitignore,添加 .turbopack 忽略项。
  • Bug Fixes

    • 前端通知:PWA 更新提示与错误通知改为使用 title 显示主要文本。
  • Tests

    • 在测试环境添加全局 ResizeObserver 的空实现。

✏️ Tip: You can customize this high-level summary in your review settings.

@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Nov 24, 2025
@github-actions

github-actions Bot commented Nov 24, 2025 •

Copy link
Copy Markdown

🎊 PR Preview has been successfully built and deployed to https://ant-design-pro-preview-pr-11585.surge.sh

@coderabbitai

coderabbitai Bot commented Nov 24, 2025 •

Copy link
Copy Markdown

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

升级依赖(Ant Design v6、Umi 包)、移除 Ant Design v5 React19 补丁,调整运行时/测试通知字段与配置项,添加测试 ResizeObserver mock,更新多个 CI 工作流的 Actions 版本与配置。未引入新运行时代码路径或导出签名变更。

Changes

Cohort / File(s) 变更摘要
依赖与包版本
package.json
升级 @ant-design/icons 到 ^6.1.0、antd 到 ^6.0.0;移除 @ant-design/v5-patch-for-react-19;升级/替换 Umi 相关包(@umijs/max 升级,新增/调整 @umijs/lint)。
导入移除
src/app.tsx
删除对 @ant-design/v5-patch-for-react-19 的导入语句。
配置变更
config/config.ts
移除顶层 mako 与 esbuildMinifyIIFE 配置;新增顶层 utoopack: {};在 configProvider.theme.token 中移除 cssVar: true。
通知字段调整
src/global.tsx, src/requestErrorConfig.ts
将 PWA 更新通知和请求错误通知中的 message 字段改为 title(错误通知用 title 显示 errorCode,保留 description)。
测试环境补充
tests/setupTests.jsx
新增全局 ResizeObserver mock,包含 observe、unobserve、disconnect 空实现。
版本控制忽略
.gitignore
在 umi 段新增忽略模式 .turbopack。
CI 工作流与工具链
.github/workflows/...
.../ci.yml, .../coverage.yml, .../deploy.yml, .../preview-build.yml
升级 GitHub Actions 版本(如 actions/checkout v4→v6、actions/setup-node v4→v5);各工作流中对应步骤的 action 版本或参数被更新,整体流程保持不变。

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • 建议重点复核:
    • package.json 中 Ant Design 主版本升级对组件 API/样式的潜在影响(关键页面运行检查)
    • config/config.ts 中移除/新增顶层配置项对插件或全局配置读取的影响
    • 通知字段由 message → title 的兼容性(所有通知调用点)
    • CI workflow 中 Actions 版本升级是否与现有 runner/环境兼容
    • 新增的 ResizeObserver mock 是否会掩盖测试中真实行为或边界情况

Poem

🐰 轻跳仓库新一跳,依赖换装春光绕。
补丁散去码更清,配置微调步自豪。
测试添了小观测,流水线也换新袍。

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR标题准确概括了主要变更:升级到Ant Design v6和Utoo Pack(即utoopack配置项),涵盖了核心的dependency更新和配置变更。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/upgrade-antd-v6

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 603da14 and 7321312.

📒 Files selected for processing (3)
  • .github/workflows/ci.yml (1 hunks)
  • .github/workflows/coverage.yml (1 hunks)
  • .github/workflows/deploy.yml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/ci.yml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: build-preview
  • GitHub Check: build (20, windows-latest)
  • GitHub Check: build (20, windows-latest)
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (3)
.github/workflows/deploy.yml (1)

14-14: actions/checkout 版本升级是安全的。

从 v4 升级到 v6 的版本更新是例行维护,不存在破坏性变更。此更改与 PR 中其他工作流的更新保持一致。

.github/workflows/coverage.yml (2)

12-12: actions/checkout 版本升级到 v6 是安全的。

此更新与部署工作流保持一致,无破坏性变更。


14-14: actions/setup-node 升级到 v5,与 Node.js 20 兼容。

从 v4 升级到 v5 是安全的,actions/setup-node@v5 完全支持 Node.js 20。


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @afc163, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request initiates the process of upgrading the project's UI framework by moving to Ant Design v6. This significant update involves bumping the antd and @ant-design/icons dependencies to their latest major versions and removing a specific compatibility patch for React 19, suggesting a streamlined integration with newer React versions. As indicated by the WIP status, further adjustments related to pro-components and antd-style are anticipated.

Highlights

  • Ant Design Upgrade: The core Ant Design library has been upgraded to version 6.0.0, bringing the latest features and improvements.
  • Ant Design Icons Upgrade: The @ant-design/icons package has been updated to version 6.1.0, ensuring compatibility with the new Ant Design version.
  • React 19 Compatibility Patch Removal: The @ant-design/v5-patch-for-react-19 dependency and its corresponding import have been removed, indicating that Ant Design v6 likely offers native compatibility or a different approach for React 19.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@dosubot dosubot Bot added the 🛂 antd label Nov 24, 2025

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This PR kicks off the upgrade to Ant Design v6. You've correctly updated the main antd and @ant-design/icons packages and removed the temporary patch for React 19. However, the current changes introduce a critical issue: other dependencies like @ant-design/pro-components and antd-style are not compatible with antd v6, which will break the application. As you continue this work, remember that antd v6 has other breaking changes that will require further code updates across the project.

Comment thread package.json
Comment on lines 39 to 41
"@ant-design/pro-components": "^2.8.9",
"antd": "^5.26.4",
"@ant-design/v5-patch-for-react-19": "^1.0.3",
"antd": "^6.0.0",
"antd-style": "^3.7.0",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

Upgrading antd to v6 is a significant change that affects other packages in the Ant Design ecosystem.

  1. @ant-design/pro-components: The current version (^2.8.9) is not compatible with antd@6. The peer dependency for @ant-design/pro-components@2.8.9 is antd: ">=4.24.0 <6.0.0". You will need to upgrade @ant-design/pro-components to a version that supports antd@6.
  2. antd-style: The current version (^3.7.0) is designed for antd@5. Given the styling system changes in antd@6 (like CSS-in-JS variables), this version is likely incompatible. You should check for a compatible version of antd-style or consider migrating if a compatible version is not available.

In its current state, these incompatibilities will break the application. As this is a WIP, you may already be tracking this, but it's a critical issue to resolve for the upgrade to be successful.

@socket-security

socket-security Bot commented Nov 24, 2025 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​umijs/​lint@​4.6.49910073100100
Added@​ant-design/​icons@​6.1.0891008788100
Addedantd@​6.0.19710010099100

View full report

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3123a53 and 8a4be2f.

📒 Files selected for processing (2)
  • package.json (1 hunks)
  • src/app.tsx (0 hunks)
💤 Files with no reviewable changes (1)
  • src/app.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: WIP
  • GitHub Check: WIP
  • GitHub Check: WIP
  • GitHub Check: WIP
  • GitHub Check: WIP
  • GitHub Check: Socket Security: Pull Request Alerts
  • GitHub Check: build-preview
  • GitHub Check: WIP
🔇 Additional comments (1)
package.json (1)

37-46: @ant-design/v5-patch-for-react-19 补丁已完全移除 - 验证通过

已确认:

  • 依赖中不存在 @ant-design/v5-patch-for-react-19(package.json ✓)
  • src/app.tsx 中无相关导入(✓)
  • 整个代码库中无任何引用(✓)

代码变更正确,与 antd v6 原生 React 19 支持相符。

Comment thread package.json
@afc163
afc163 marked this pull request as draft November 24, 2025 03:44
@afc163 afc163 mentioned this pull request Nov 24, 2025
16 tasks
@Eliot00

Eliot00 commented Dec 2, 2025 •

Copy link
Copy Markdown
Contributor

本地升级了umi,可以正常启动

-    "@umijs/lint": "^4.3.24",
-    "@umijs/max": "^4.3.24",
+    "@umijs/lint": "^4.6.1",
+    "@umijs/max": "^4.6.1",

@afc163

afc163 commented Dec 2, 2025

Copy link
Copy Markdown
Member Author

@copilot 参考更新一下 PR

-    "@umijs/lint": "^4.3.24",
-    "@umijs/max": "^4.3.24",
+    "@umijs/lint": "^4.6.1",
+    "@umijs/max": "^4.6.1",

Copilot AI commented Dec 2, 2025

Copy link
Copy Markdown
Contributor

@afc163 I've opened a new pull request, #11589, to work on those changes. Once the pull request is ready, I'll request review from you.

Co-authored-by: afc163 <507615+afc163@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Dec 2, 2025 •

Copy link
Copy Markdown

Deploying ant-design-pro with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7321312
Status: ✅  Deploy successful!
Preview URL: https://d59395bb.ant-design-pro-nd3.pages.dev
Branch Preview URL: https://feat-upgrade-antd-v6.ant-design-pro-nd3.pages.dev

View logs

@codecov

codecov Bot commented Dec 3, 2025 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 53.60%. Comparing base (80b9902) to head (7321312).
⚠️ Report is 9 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #11585      +/-   ##
==========================================
- Coverage   53.67%   53.60%   -0.08%     
==========================================
  Files          84       84              
  Lines         598      597       -1     
  Branches       79       81       +2     
==========================================
- Hits          321      320       -1     
  Misses        277      277              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@afc163
afc163 marked this pull request as ready for review December 3, 2025 10:38
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels Dec 3, 2025
@afc163 afc163 changed the title [WIP ]feat: upgrade to antd v6 feat: upgrade to antd v6 and utoo pack Dec 3, 2025
@dosubot dosubot Bot added the 🍚 umi label Dec 3, 2025

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
package.json (1)

38-45: 依赖版本升级方向正确,注意后续补齐生态包兼容性

本次将:

  • antd 升级到 ^6.0.0,@ant-design/icons 升级到 ^6.1.0
  • Umi 相关升级到 @umijs/max@^4.6.2、@umijs/lint@^4.6.1

整体方向与 PR 目标一致 👍。不过当前仍然保留:

  • @ant-design/pro-components: ^2.8.9
  • antd-style: ^3.7.0

它们与 antd@6 的兼容性问题已经在之前的机器人评论中标记为 critical,这里不再展开,后续合并前需要一并处理或在后续 PR 中升级。

建议本地执行一次安装并检查 peerDependencies 警告,确保版本矩阵最终闭环:

npm install
npm ls antd @ant-design/pro-components antd-style

Also applies to: 58-59

🧹 Nitpick comments (2)
tests/setupTests.jsx (1)

72-78: ResizeObserver mock 建议同时挂到 window 上

现在只设置了 global.ResizeObserver,如果有代码直接访问 window.ResizeObserver 可能仍然报错。可以顺带同步一份到 window,更稳妥。

-// Mock ResizeObserver
-global.ResizeObserver = class ResizeObserver {
-  observe() {}
-  unobserve() {}
-  disconnect() {}
-};
+// Mock ResizeObserver
+class ResizeObserver {
+  observe() {}
+  unobserve() {}
+  disconnect() {}
+}
+
+global.ResizeObserver = ResizeObserver;
+if (typeof window !== 'undefined') {
+  // 部分依赖使用 window.ResizeObserver
+  // @ts-ignore
+  window.ResizeObserver = ResizeObserver;
+}
src/requestErrorConfig.ts (1)

48-64: Swap notification title and description for better UX alignment with Ant Design v6 best practices.

Ant Design v6 recommends that notification titles be short, outcome-oriented, and user-friendly, while error codes should appear in the description for support reference. Currently, title displays errorCode (technical) and description displays errorMessage (raw backend data). This conflicts with the convention—consider:

notification.open({
  title: errorMessage,
  description: errorCode,
});

This assumes errorMessage from the backend is already user-friendly. If backend messages are technical, implement a client-side error mapper (as shown in Ant Design best practices) to transform error codes into friendly titles before display. The current approach is also inconsistent with other message types (WARN_MESSAGE, ERROR_MESSAGE) in this same handler, which display errorMessage directly without wrapping it in a secondary field.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8a4be2f and fe43cbf.

⛔ Files ignored due to path filters (1)
  • src/pages/user/login/__snapshots__/login.test.tsx.snap is excluded by !**/*.snap
📒 Files selected for processing (6)
  • .gitignore (1 hunks)
  • config/config.ts (1 hunks)
  • package.json (2 hunks)
  • src/global.tsx (1 hunks)
  • src/requestErrorConfig.ts (1 hunks)
  • tests/setupTests.jsx (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: WIP
  • GitHub Check: WIP
  • GitHub Check: build-preview
  • GitHub Check: build (20, windows-latest)
  • GitHub Check: WIP
  • GitHub Check: build (20, windows-latest)
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (2)
.gitignore (1)

31-35: 新增 .turbopack 忽略项是合理的

针对新打包器产生的缓存目录加到 .gitignore 中是正确的做法,不会影响现有流程。

src/global.tsx (1)

68-76: PWA 更新提示改用 title 字段是合理的

这里将 notification.open 的主文案从 message 切到 title,语义和文案都保持不变,符合新版 API 要求,逻辑无问题。

Comment thread config/config.ts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (2)
.github/workflows/deploy.yml (1)

17-23: 更新步骤名称以反映实际使用的工具。

工作流已正确迁移至 utoo 工具链(第 17 行的 utooland/setup-utoo@v1 和第 20、23 行的 utoo 命令),但第 19 行的步骤名称仍然引用 "Bun",与实际执行的 utoo install 命令不符。

建议更新步骤名称以提高清晰度:

-      - name: Install dependencies with Bun
+      - name: Install dependencies with utoo
         run: utoo install
.github/workflows/ci.yml (1)

26-30: 确认内存配置是否适合新工具链

新增的 NODE_OPTIONS: --max_old_space_size=4096 将 Node.js 堆大小限制为 4GB。请确认:

  1. 这个内存配置是否为 utoo 工具链的推荐值
  2. 这个大小是否足以支持所有矩阵组合(Windows、macOS、Ubuntu)的构建
  3. 是否需要针对不同操作系统进行不同的内存配置

如果 Bun 被替换为需要更多内存的 utoo,当前配置可能导致某些环境下的 OOM(内存不足)错误。

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fe43cbf and 603da14.

📒 Files selected for processing (4)
  • .github/workflows/ci.yml (1 hunks)
  • .github/workflows/coverage.yml (1 hunks)
  • .github/workflows/deploy.yml (1 hunks)
  • .github/workflows/preview-build.yml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: build-preview
  • GitHub Check: build
  • GitHub Check: build
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (3)
.github/workflows/preview-build.yml (1)

15-15: GitHub Actions 版本升级符合预期。

将 actions/checkout 从 v4 升级至 v6,以获取最新的安全补丁和功能改进。参数传入保持一致,功能行为不受影响。这次升级符合 PR 的 CI 工具链现代化目标。

.github/workflows/deploy.yml (1)

14-14: ✓ actions/checkout 版本升级正确。

从 v4 升级到 v6 是标准的依赖更新,无功能性影响。

.github/workflows/ci.yml (1)

16-20: 验证 GitHub Actions 版本兼容性

GitHub Actions 的版本升级(checkout v6 和 setup-node v5)是常规维护更新。建议验证这些新版本与项目的其他 CI 步骤的兼容性,尤其是与新的 utoo 工具链的集成。

Comment thread .github/workflows/ci.yml Outdated
Comment thread .github/workflows/coverage.yml Outdated
@afc163
afc163 force-pushed the feat/upgrade-antd-v6 branch from 4eb98a6 to 7321312 Compare December 4, 2025 02:32
@afc163
afc163 merged commit c7a10e4 into master Dec 4, 2025
20 checks passed
@afc163
afc163 deleted the feat/upgrade-antd-v6 branch December 4, 2025 03:04
@Eliot00

Eliot00 commented Dec 4, 2025

Copy link
Copy Markdown
Contributor

这个版本pnpm dev报错

ModuleBuildError: ./src/.umi/plugin-openapi/openapi.tsx:7:7
Module not found: Can't resolve 'swagger-ui-dist'
   5 |       // DO NOT CHANGE IT MANUALLY!
   6 |       import { useEffect, useState } from 'react';
>  7 |       import { SwaggerUIBundle } from 'swagger-ui-dist';
     |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   8 |       import 'swagger-ui-dist/swagger-ui.css';
   9 |       const App = () => {
  10 |         const [value, setValue] = useState("openapi" );





./src/.umi/plugin-openapi/openapi.tsx:8:7
Module not found: Can't resolve 'swagger-ui-dist/swagger-ui.css'
   6 |       import { useEffect, useState } from 'react';
   7 |       import { SwaggerUIBundle } from 'swagger-ui-dist';
>  8 |       import 'swagger-ui-dist/swagger-ui.css';
     |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   9 |       const App = () => {
  10 |         const [value, setValue] = useState("openapi" );
  11 |         useEffect(() => {




    at processIssues (/Volumes/Extra/Code/Free/ant-design-pro/node_modules/.pnpm/@utoo+pack@1.0.3_@types+webpack@5.28.5_webpack@5.100.2/node_modules/@utoo/pack/cjs/util.js:43:15)
    at /Volumes/Extra/Code/Free/ant-design-pro/node_modules/.pnpm/@utoo+pack@1.0.3_@types+webpack@5.28.5_webpack@5.100.2/node_modules/@utoo/pack/cjs/hmr.js:132:114
    at async Promise.all (index 0)
    at async handleEntrypointsSubscription (/Volumes/Extra/Code/Free/ant-design-pro/node_modules/.pnpm/@utoo+pack@1.0.3_@types+webpack@5.28.5_webpack@5.100.2/node_modules/@utoo/pack/cjs/hmr.js:132:13)

浏览器报错:

Uncaught (in promise) TypeError: can't access property 0, data.bundleStatus.progresses is undefined

@Wxh16144

Wxh16144 commented Dec 4, 2025

Copy link
Copy Markdown
Member

这个版本pnpm dev报错

ModuleBuildError: ./src/.umi/plugin-openapi/openapi.tsx:7:7
Module not found: Can't resolve 'swagger-ui-dist'
   5 |       // DO NOT CHANGE IT MANUALLY!
   6 |       import { useEffect, useState } from 'react';
>  7 |       import { SwaggerUIBundle } from 'swagger-ui-dist';
     |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   8 |       import 'swagger-ui-dist/swagger-ui.css';
   9 |       const App = () => {
  10 |         const [value, setValue] = useState("openapi" );





./src/.umi/plugin-openapi/openapi.tsx:8:7
Module not found: Can't resolve 'swagger-ui-dist/swagger-ui.css'
   6 |       import { useEffect, useState } from 'react';
   7 |       import { SwaggerUIBundle } from 'swagger-ui-dist';
>  8 |       import 'swagger-ui-dist/swagger-ui.css';
     |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   9 |       const App = () => {
  10 |         const [value, setValue] = useState("openapi" );
  11 |         useEffect(() => {




    at processIssues (/Volumes/Extra/Code/Free/ant-design-pro/node_modules/.pnpm/@utoo+pack@1.0.3_@types+webpack@5.28.5_webpack@5.100.2/node_modules/@utoo/pack/cjs/util.js:43:15)
    at /Volumes/Extra/Code/Free/ant-design-pro/node_modules/.pnpm/@utoo+pack@1.0.3_@types+webpack@5.28.5_webpack@5.100.2/node_modules/@utoo/pack/cjs/hmr.js:132:114
    at async Promise.all (index 0)
    at async handleEntrypointsSubscription (/Volumes/Extra/Code/Free/ant-design-pro/node_modules/.pnpm/@utoo+pack@1.0.3_@types+webpack@5.28.5_webpack@5.100.2/node_modules/@utoo/pack/cjs/hmr.js:132:13)

浏览器报错:

Uncaught (in promise) TypeError: can't access property 0, data.bundleStatus.progresses is undefined

得用 npm 包管理器。 我提交了一个 PR 尝试修复这个问题,umijs/umi-presets-pro#21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🛂 antd size:M This PR changes 30-99 lines, ignoring generated files. 🍚 umi

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants