Repository navigation
fix(ci): generate route types before typechecking, and drop the impossible Node 20 leg - #7
Merged
Merged
Conversation
`pnpm typecheck` fails on a clean checkout. Next 16 emits `LayoutProps` and `PageProps` as global route types during the build, but CI ran the typecheck before the build step: src/app/layout.tsx(14,56): error TS2304: Cannot find name 'LayoutProps'. src/app/page.tsx(8,58): error TS2304: Cannot find name 'PageProps'. src/app/page.tsx(13,54): error TS2304: Cannot find name 'PageProps'. Add a `typegen` script and run it before the typecheck step. Verified from a clean `.next`: typecheck fails before typegen, passes after, and lint/build are unaffected. The script is also useful locally on its own (`pnpm typegen`).
The pinned pnpm 11.22.0 requires Node.js >= 22.13, so the Node 20 matrix entry died in setup-node before install ever ran: warn: This version of pnpm requires at least Node.js v22.13 Error [ERR_UNKNOWN_BUILTIN_MODULE]: No such built-in module: node:sqlite Node.js v20.20.2 `.nvmrc` already declares 22, so the matrix, `engines.node`, and the README and CONTRIBUTING requirements were all stating a floor the toolchain cannot honour. Align them all to 22.13 and test 22 alongside the current line. Verified on this branch: `pnpm typegen && pnpm typecheck && pnpm build` from a clean `.next`, and the Node 22 CI leg passes end to end.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CI has been red on
mainfor two independent reasons. This fixes both, andaligns the declared Node floor with what the toolchain actually requires.
1.
pnpm typecheckran before the build generated its route types. Next 16emits
LayoutProps/PagePropsas global route types during the build, so aclean checkout failed:
Added a
typegenscript and run it before the typecheck step.2. The Node 20 matrix leg could never run. The pinned
pnpm@11.22.0requires Node.js >= 22.13, so that leg died in
setup-nodebeforeinstall:.nvmrcalready declares 22, whileengines.node, both READMEs, andCONTRIBUTING all advertised
>= 20.9. Aligned everything to 22.13 and thematrix now tests 22 alongside 24.
Type of change
Testing
Simulated the CI job from a clean
.next(Linux, pnpm 11.22.0 — Node v26.9.0locally, which satisfies the new floor):
Also confirmed on CI itself: with only the first commit, the Node 22 leg
passed every step (including the new typegen step) while Node 20 failed in
setup-node — which is what surfaced defect 2.
pnpm typecheckpnpm lintpnpm buildChecklist
enandzhinsrc/i18n/— n/aNote on the second change
Dropping the Node 20 leg is forced, not a policy preference: the pinned pnpm
cannot run there. If you would rather keep Node 20 support, the alternative
is pinning an older pnpm — say the word and I'll redo it that way instead.
I could not verify the new Node 24 leg locally (this machine runs 26), so
worth watching the first run. Switching it to
26or dropping it to[22]isa one-line change.
Related issues
Fixes the red CI on
main(latest pre-PR failing run: 2026-09-29T14:18Z). Notracking issue exists.