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

Offen Anfängerfreundlich
#29,587 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

@Umais-Adeed arbeitet bereits daran.

Seit 04.11.2026.

  • #30666 von @Umais-Adeed — offen

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
82/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
nodejs, typescript
Bereich
build-system

Rechercherichtung

Der fehlerhafte Pfad stammt vom @betteroffice/fonts-cjk-Alias in apps/web/vite.config.ts, der seinen Pfad mit new URL(...).pathname bildet. Reproduziere das, indem du in ein Verzeichnis klonst, dessen Name ein Leerzeichen enthält, und dann vp build in apps/web ausführst. Der gemeldete Fix besteht darin, die URL in fileURLToPath aus node:url zu wrappen. Erledigt, wenn der Build aus dem Pfad mit Leerzeichen erfolgreich ist und weiterhin aus einem normalen Pfad erfolgreich ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.

Vorherrschende Sprache
TypeScript
Sterne
24.8k
Forks
6.4k
Ø Merge
7 Std. 33 Min.
Gemergte PRs (30 T.)
96

Entwicklungsumgebung

In Codespaces öffnen

Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus pingdotgg/t3code

Alle Issues in pingdotgg/t3code

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.