Bug: pre-existing TS errors block pnpm run build on master (5 errors in test files, @types/react bigint/ReactNode) #5116
Replies: 2 comments 1 reply
|
Agreed — if The failure mode matches Practical interim for people who only need a web dist: typecheck/build src and skip the client test aggregate — but that should not stay the official path. For maintainers, any of these is enough:
Until one of those lands, every fresh clone of this revision will look “broken at build” even with a clean tree. |
|
Checked the actual root cause guess and it doesn't hold up. I pulled the real @types/react@18.3.31 index.d.ts (the exact version pinned in pnpm-lock.yaml, confirmed only one resolved version site-wide, no duplicate copy) and its ReactNode type is: ReactElement | string | number | Iterable | ReactPortal | boolean | null | undefined | DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_REACT_NODES[keyof DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_REACT_NODES] That last part is the React 19 forward-compat escape hatch, but in 18.3.31 it's declared as an empty interface, so keyof {} is never and that whole branch contributes nothing. There is no bigint anywhere in this ReactNode definition. So "@types/react widened ReactNode to include bigint" isn't what's happening here, and pinning a different @types/react version on its own won't fix it, since the type itself never had bigint. That means the bigint has to be coming from something in the repo's own source, not from upstream. packages/client/ui-primitives/src/JsonTree.tsx explicitly branches on typeof value === 'bigint' in a few places, so there's at least one real bigint-aware type living in the client packages already. All three failing call sites in your report go through createSlotRenderer().renderRoot(...), whose return type is declared as plain ReactNode in packages/client/ui-slots/src/renderer.ts:214, imported the normal way (import type { ReactNode } from 'react'), same package everywhere. I did not manage to trace the exact expression that infers bigint without actually running tsc with --explainFiles or hovering the failing line in an editor, so I can't hand you the final root cause. But I can save you from chasing the @types/react angle: that part is confirmed not the cause. Worth checking whether something feeding into the slot host or owner props (schemastery-derived types show up a lot in this repo and can widen to include bigint) changed recently, even if the three test files themselves didn't. |
Uh oh!
There was an error while loading. Please reload this page.
Bug report — pre-existing TypeScript errors block
pnpm run build/build:lib:clienton master (5 errors in test files)Summary
pnpm run build(andbuild:lib:client→tsc -b tsconfig.client.json) fails on current master (cd5ef814) with 5 TypeScript errors in 3 test files that are unrelated to any recent change — allReactNode-vs-bigintincompatibilities from@types/reactunderexactOptionalPropertyTypes. This blocks the canonical build for any contributor (including CI on Windows).Reproduction
masteratcd5ef814, Nodev24.9.0,pnpm install(lockfile).pnpm exec tsc -b tsconfig.client.json→ exit 1.Errors (path:line)
The failing files are byte-identical to the original HEAD (
git diff cd5ef814 -- <file>is empty), so the errors are pre-existing on master, not introduced by local work.Likely cause
@types/react@18.3.31widenedReactNodehandling (or abigint-typed value/newReacttype resolution under"types"/skipLibChecksettings intsconfig.client.json) interacting withexactOptionalPropertyTypes: trueintsconfig.base.client.json. Worth checking whether a@types/reactpin or atsconfig.base.client.jsonskipLibCheck/ReactNode adjustment is intended.Impact
pnpm run build(used by CI and by the web dev loop pre-requisite) fails on the client phase.Suggested fix (for maintainers)
Either pin
@types/reactto a version whoseReactNodeacceptsbigint, or addskipLibCheck: trueto the client typecheck aggregate, or adjust the three test files' fixtures. Happy to open a PR with the fix once external PRs are accepted (CONTRIBUTING.md currently declines external PRs).All reactions