[Bug]: Web build fails when the checkout path contains a space (fonts-cjk alias keeps %20)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 82/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- nodejs, typescript
- 领域
- build-system
调研方向
错误的路径来自 apps/web/vite.config.ts 中的 @betteroffice/fonts-cjk 别名,该别名用 new URL(...).pathname 构建其路径。复现方法是克隆到一个名称包含空格的目录,然后在 apps/web 中运行 vp build。报告的修复是将 URL 包装进 fileURLToPath,它来自 node:url。当从带空格的路径构建成功,并且从普通路径也仍然构建成功时,即完成。
由索引模型根据 Issue 内容生成。
描述
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area
Build, CI, or release tooling
Steps to reproduce
- Clone the repo into a directory whose path contains a space, e.g.
~/Local Sites/t3code. pnpm install --frozen-lockfile --filter=@t3tools/web...cd apps/web && vp build
Expected behavior
The web app builds, as it does from a path without spaces.
Actual behavior
The build fails while bundling the office file viewers' worker:
[plugin vite:worker-import-meta-url] …/apps/web/src/components/files/office/WordDocument.tsx
[UNLOADABLE_DEPENDENCY] Could not load ../../../../Local%20Sites/t3code/apps/web/src/components/files/office/fonts-cjk.ts
╭─[ ../../node_modules/.pnpm/@[email protected]/node_modules/@betteroffice/fonts/dist/index.js:574:26 ]
574 │ return (await import("@betteroffice/fonts-cjk")).CJK_FONT_ASSET_URLS;
│ ╰── No such file or directory (os error 2)
(The same error for Presentation.tsx.)
Cause: apps/web/vite.config.ts resolves the alias with new URL("./src/components/files/office/fonts-cjk.ts", import.meta.url).pathname. URL.pathname is percent-encoded, so a space becomes %20 and the aliased path does not exist. fileURLToPath decodes it:
import * as NodeURL from "node:url";
// …
"@betteroffice/fonts-cjk": NodeURL.fileURLToPath(
new URL("./src/components/files/office/fonts-cjk.ts", import.meta.url),
),
With that change the build succeeds from the same path.
Impact
Minor bug or occasional failure
Version or commit
v0.1.5 and v0.1.6; still present on main at 84537c4dd9 (2026-11-02).
Environment
macOS 26.7.1 (arm64), Node 26.12.0, pnpm 12.14.0, vite-plus 1.4.0.
Workaround
Build from a path without spaces, or apply the fileURLToPath change above.
- 主要语言
- TypeScript
- 星标
- 24.8k
- 派生
- 6.4k
- 平均合并
- 7 小时 39 分钟
- 30 天内合并 PR
- 123
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
pingdotgg/t3code 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 84/100
pingdotgg/t3code#30228 · 2 条评论 ·
维护者通常 1 天内回复
-
[Bug]: ACP sign-in replaces the agent's error message with a generic one可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭bug needs-triage
难度 1/5 1 小时以内 新手友好度 85/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
[Bug]: iOS: typing a custom answer on a question card doesn't autocorrect可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
相似的 Issue
-
apps/stage-web bug env/os-linux pending triage scope/audio-output
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
reproduced
难度 2/5 1-3 小时 新手友好度 68/100
anomalyco/opencode#61640 · 1 条评论 ·
维护者通常 1 天内回复
-
scope: data grid status: waiting for maintainer
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 2 天内回复
-
ai-driven-fuzzing bug Minor
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
ai-driven-fuzzing bug claude Minor
难度 2/5 1-3 小时 新手友好度 82/100
linagora/twake-calendar-frontend#1944 ·
维护者通常 1 天内回复