[Bug]: Web build fails when the checkout path contains a space (fonts-cjk alias keeps %20)

オープン 初心者向け
#29,587 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
82/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
nodejs, typescript
領域
build-system

調査の方向性

不正なパスは apps/web/vite.config.ts 内の @betteroffice/fonts-cjk エイリアスに由来し、このエイリアスは new URL(...).pathname でパスを構築します。名前にスペースを含むディレクトリに clone し、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
  1. Clone the repo into a directory whose path contains a space, e.g. ~/Local Sites/t3code.
  2. pnpm install --frozen-lockfile --filter=@t3tools/web...
  3. 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分
マージ済み PR(30日)
123

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

pingdotgg/t3code のほかの issue

pingdotgg/t3code の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。