From ca919c330704ff2008316f6170b8b18b9104086b Mon Sep 17 00:00:00 2001 From: Rogee Date: Wed, 23 Sep 2026 14:20:41 +0800 Subject: [PATCH] =?UTF-8?q?fix(web):=20=E6=98=BE=E5=BC=8F=E5=85=B3?= =?UTF-8?q?=E9=97=AD=20umi=20icons=20=E7=89=B9=E6=80=A7=EF=BC=8C=E6=B6=88?= =?UTF-8?q?=E9=99=A4=20dev=20=E5=90=AF=E5=8A=A8=E5=81=B6=E5=8F=91=E6=95=B4?= =?UTF-8?q?=E5=B1=8F=20esbuild=20ERROR?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根因:@umijs/max 内建的 icons 预构建会在启动早期用 esbuild 扫描源码、 按别名解析 src/.umi 临时产物;窗口期内临时文件未就绪即报 "Could not resolve src/.umi/umi.ts"、"Can't resolve .umi/exports" 等 整屏 ERROR(webpack 编译与页面功能不受影响)。上游同类竞态的已知问题 (umijs/umi#10339 修过一处同类)。本项目图标全部直接来自 @ant-design/icons, 不使用该特性,故显式 icons: false 关闭,扫描进程不再启动。 --- web/.umirc.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/web/.umirc.ts b/web/.umirc.ts index 361d32d..b037fa2 100644 --- a/web/.umirc.ts +++ b/web/.umirc.ts @@ -13,4 +13,7 @@ export default defineConfig({ }, }, npmClient: 'npm', + // 未使用 @umijs/max 的 icons 能力(图标全部来自 @ant-design/icons),显式关闭: + // 该特性的 esbuild 预构建扫描会在启动早期解析 src/.umi 临时文件,偶发竞态导致整屏 ERROR(编译实际成功) + icons: false, });