fix(web): the web build works from a checkout path with spaces#30666
Problem
vp build in apps/web fails when the checkout path contains a space. The @betteroffice/fonts-cjk alias in apps/web/vite.config.ts was resolved with new URL(...).pathname, which percent-encodes the space as %20, so the aliased file does not exist. Fixes #29587.
Change
Resolve the alias with NodeURL.fileURLToPath(new URL(...)), which decodes the path, as the issue suggests.
Scope and approval
One-line fix for the build bug reported in #29587.
Verification
Built apps/web from a fresh checkout at /home/…/t3 space repro on e68e19d605:
- Before:
vp buildexits 1 with[UNLOADABLE_DEPENDENCY] Could not load ../../../t3%20space%20repro/apps/web/src/components/files/office/fonts-cjk.ts … No such file or directory. - After:
vp buildexits 0,✓ built in 16.02s. vp run check:changed: format, lint, knip, and typecheck pass.
No test added: this is build configuration, and the build in CI covers it. No UI change.
Done with Claude Opus 5.5 in Claude Code (T3 Code).
🤖 Generated with Claude Code
Checks
Added 1 commit
- fix(web): the web build works from a checkout path with spaces51ca6c0
Approvability
Verdict: Approved at 51ca6c0
Macroscope's review found this PR approvable — The web build now converts the existing font alias URL into a native filesystem path, supporting checkout directories containing spaces. The alias target and font behavior remain unchanged, with no material operational exposure.
Notes:
- All code in this push has already been reviewed. Approvability was decided on eligibility alone.
You can add or adjust custom eligibility rules. Learn more.
Important
Review skipped
Review was skipped as selected files did not have any reviewable changes.
External image Run configuration
-
- Source mode: Auto
- Repository: pingdotgg/t3code
- Branch: main
- File: .coderabbit.config.ts
- Commit: b3fdf2b
- Layers: Repository TS config
- Review profile: CHILL
- Plan: Advanced
- Run ID:
384c41a8-ab1c-48d8-8e5b-ab7041c4af20
External image Commits
-
Reviewing files that changed from the base of the PR and between 51ca6c0594a1e3b334e3aae7b2abf59b34136623 and e553f9f4dcc66a325a4db2795b4eed111f7946ce.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
- Trigger review
No actionable comments were generated in the recent review.
Walkthrough
-
The Vite configuration imports
node:urland converts the fonts-CJK alias URL to a filesystem path withfileURLToPath.Changes: Web fonts-CJK alias
Layer / File(s) Summary Convert the alias URL to a filesystem path
apps/web/vite.config.tsThe fonts-CJK alias now uses fileURLToPathinstead of the URL’s.pathname.Estimated code review effort: 2 (Simple) | ~8 minutes
Change: Bug fix · Severity of issue fixed: Low
Possibly related PRs
- pingdotgg/t3code#27648: Makes the same change to the fonts-CJK alias.
- pingdotgg/t3code#26230: Changes the same fonts-CJK alias implementation.
- pingdotgg/t3code#30080: Applies similar URL-to-filesystem-path handling to relay migrations.
Suggested reviewers:
maria-rcks
Merge Risk: External image Minimal · previous review 51ca6
-
The path-space build issue is addressed without introducing additional merge-blocking risk.
Pre-merge checks: Passed 4
-
Check name Status Explanation Title check Passed The title clearly and concisely describes the primary change: fixing the web build when the checkout path contains spaces. Description check Passed The description includes the required Problem, Change, Scope and approval, and Verification sections. It explains the failure, the fix, the linked issue, the focused scope, and the before-and-after bu… Linked Issues check Passed [ #29587] The only coding requirement is that the web build succeeds from a checkout path that contains a space. The root cause is that the@betteroffice/fonts-cjkalias inapps/web/vite.config.ts…Out of Scope Changes check Passed The whole-PR diff changes one file, apps/web/vite.config.ts. It adds thenode:urlimport and changes the fonts-CJK alias expression. Both edits serve the objective of#29587. No unrelated file or …Full details: Description check
-
Explanation
The description includes the required Problem, Change, Scope and approval, and Verification sections. It explains the failure, the fix, the linked issue, the focused scope, and the before-and-after build results.
Full details: Linked Issues check
-
Explanation
[
#29587] The only coding requirement is that the web build succeeds from a checkout path that contains a space. The root cause is that the@betteroffice/fonts-cjkalias inapps/web/vite.config.tsusednew URL(...).pathname, which keeps%20in the path. The diff at merge base e68e19d605 to head 51ca6c0594 replaces this withNodeURL.fileURLToPath(new URL("./src/components/files/office/fonts-cjk.ts", import.meta.url)), withimport * as NodeURL from "node:url"added. This is the fix the issue proposes.fileURLToPathdecodes the percent-encoded path, so the aliased file resolves. The issue requests no automated test, and the change is a one-line configuration fix. The author's before and after build results are reported in the PR description. I did not run the build. The result rests on the code change and the correct decoding behavior offileURLToPath.
Full details: Out of Scope Changes check
-
Explanation
The whole-PR diff changes one file,
apps/web/vite.config.ts. It adds thenode:urlimport and changes the fonts-CJK alias expression. Both edits serve the objective of#29587. No unrelated file or behavior changes appear in the diff. Thenode:urlimport follows the existingnode:fs/promisesandnode:zlibimports in the same file. The raw summary reports no changes to exported declarations, which matches the diff.
-
Finishing Touches
-
Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
External image Recent review info
-
External image Run configuration
-
- Source mode: Auto
- Repository: pingdotgg/t3code
- Branch: main
- File: .coderabbit.config.ts
- Commit: e68e19d
- Layers: Repository TS config
- Review profile: CHILL
- Plan: Advanced
- Run ID:
5635579a-37fc-42ab-9999-23576fbffa63
External image Commits
-
Reviewing files that changed from the base of the PR and between e68e19d605485db6ef31b2033f67a9d07634fc2b and 51ca6c0594a1e3b334e3aae7b2abf59b34136623.
External image Files selected for processing: 1
-
apps/web/vite.config.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
External image Recent review info
-
External image Run configuration
-
- Source mode: Auto
- Repository: pingdotgg/t3code
- Branch: main
- File: .coderabbit.config.ts
- Commit: e68e19d
- Layers: Repository TS config
- Review profile: CHILL
- Plan: Advanced
- Run ID:
5635579a-37fc-42ab-9999-23576fbffa63
External image Commits
-
Reviewing files that changed from the base of the PR and between e68e19d605485db6ef31b2033f67a9d07634fc2b and 51ca6c0594a1e3b334e3aae7b2abf59b34136623.
External image Files selected for processing: 1
-
apps/web/vite.config.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
-
Note
Written by gpt-6.1-sol on behalf of Maria
Verified in a real dev environment
verified exact head 51ca6c0594a1e3b334e3aae7b2abf59b34136623 on a linux boat vm. no source changes were needed.
- reproduced on
github/main(8b44f42b14): the web build in a real directory containing spaces failed withUNLOADABLE_DEPENDENCYforreal%20t3%20main/.../fonts-cjk.ts. - the pr's web build passed in a real directory containing spaces and in a normal path. builds and
check:changedran through blacksmith. format, lint, knip, and affected typechecks passed. - ran
vp iand the real background dev server from/home/user/pr space. used the repo's playwright with/usr/bin/google-chrome. - added a real git project through the app. a real codex
gpt-6.1-solturn created word, powerpoint, and markdown files. the word viewer rendered the heading, paragraph, bold, and italic text. the powerpoint viewer rendered its title and subtitle. markdown preview worked. - a second codex turn read the files and returned hashes matching an independent
sha256sumcheck. no mocks, fixtures, or demo app state.
word document rendered from the spaced checkout
powerpoint rendered from the spaced checkout
word, powerpoint, and markdown viewer interaction recording
Not verified
native desktop, ios, android, macos, and windows were not exercised on this linux vm. remote relay/tunnel connections and other providers were not exercised. optional cjk glyph coverage was not tested; this change preserves the existing font fallback.
Added 1 commit
- Merge remote-tracking branch 'origin/main' into fix/web-build-path-with-spacee553f9f
Evidence
In independent checkouts named checkout with spaces, run vp i at the root, then vp build from apps/web. Both installs succeeded. Environment for both captures: Linux x86_64, Node 26.12.1, pnpm 12.14.0, Vite+ 1.4.0; no seeded state. These images show excerpts of actual captured build output.
| Before | After |
|---|---|
| b3fdf2b10f | e553f9f4dc |
| Before: build fails loading percent-encoded fonts-cjk path | After: build succeeds and emits fonts-cjk asset |
Exit 1: UNLOADABLE_DEPENDENCY, checkout%20with%20spaces/.../fonts-cjk.ts, file not found. | Exit 0: font asset emitted; production build completed. |
Before full build transcript · After full build transcript · Reproduction driver
AI-assisted; verified with the tests and tools listed above.
Thanks for this. Main has the change since #29051.
Compared the complete diff: this PR only corrects URL decoding for the fonts-cjk stub alias, while main removes that alias and stub entirely and resolves the installed font package, eliminating the same build failure.
Closing as superseded.