Skip to content

fix(playground): generate React Router route types during the build - #866

Closed
morinokami wants to merge 1 commit into
voidzero-dev:mainfrom
morinokami:fix/react-router-typegen
Closed

morinokami wants to merge 1 commit into
voidzero-dev:mainfrom
morinokami:fix/react-router-typegen

Conversation

@morinokami

Copy link
Copy Markdown
Collaborator

This PR makes the React Router playground generate its route types during the build, so that vp check passes on a fresh checkout. The build and typecheck job has failed on main since 7937843 with three errors in playground/react-router.

Changes

Run react-router typegen before vp build

Since 7937843, vp check typechecks playground/react-router. Its routes import ./+types/smoke and ./+types/users, which React Router writes to .react-router/types. Only the dev server and react-router typegen write that folder; vp build does not. CI runs vp run build:all and then vp check on a fresh checkout, so the folder was missing and the check failed. A local checkout usually has the folder from an earlier dev server or test run, which hides the problem.

The playground's build script now runs react-router typegen first, so vp run build:all leaves the types in place, as TESTING.md describes for generated app types.

Before / after

vp check after removing playground/react-router/.react-router and running vp run build:all:

 pass: All 2924 files are correctly formatted
-error: Lint or type issues found
-× typescript(TS2307): Cannot find module './+types/smoke' or its corresponding type declarations.
-   ╭─[playground/react-router/app/routes/smoke.tsx:4:28]
-× typescript(TS2307): Cannot find module './+types/users' or its corresponding type declarations.
-   ╭─[playground/react-router/app/routes/users.tsx:3:28]
-× typescript(TS7006): Parameter 'user' implicitly has an 'any' type.
-   ╭─[playground/react-router/app/routes/users.tsx:25:23]
-Found 3 errors and 0 warnings in 2447 files
+pass: Found no warnings, lint errors, or type errors in 2447 files

Design decisions

  • The change is in the playground's build script, so CI and local runs get the types from the same vp run build:all step. The workflow files are unchanged.
  • .react-router/ stays ignored by Git.

Checked

  • The CI steps, starting without .react-router: vp run --cache build:all, node test/check-playground-build-artifacts.mjs, vp check and vp run check:types
  • packages/void/test/integration/react-router.test.ts

🤖 Generated with Claude Code

`vp check` now typechecks playground/react-router, whose routes import
`./+types/*`. Only the dev server and `react-router typegen` write those
files, so a fresh checkout had none after `vp run build:all` and the check
failed in CI.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J8F8mZkyRDommrR2VQzcuN
@morinokami
morinokami requested a review from a team as a code owner November 17, 2026 09:32
@cpojer

cpojer commented Nov 17, 2026

Copy link
Copy Markdown
Member

Woops, I fixed the same thing just now.

@morinokami

Copy link
Copy Markdown
Collaborator Author

Got it, closing this then. Thanks!

@morinokami morinokami closed this Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants