CI flake: nondeterministic mass TS2786 typecheck failures from duplicate @types/react majors in lockfile #1449

Open
opened 2026-08-27 07:29:23 +00:00 by fred · 0 comments
Collaborator

Summary

CI typecheck fails nondeterministically with mass TS2786 errors ("'X' cannot be used as a JSX component ... Property 'children' is missing in type 'ReactPortal'") across apps/web, on diffs that cannot cause it (docs-only). This is a distinct flake class from #1448 (SPA spec timeouts) and #1349 (slow-node test timing).

Evidence

  • Pipeline 2869 (branch contract/custody-schema, head f8ac64f5, docs-only diff vs next): typecheck PASS. Real run — turbo cache-miss lines present in the log.
  • Pipeline 2870 (branch contract/onboarding-wizard, head 3824fc6a, docs-only diff vs next): typecheck FAIL with mass TS2786, minutes later on the same base (a3b0770205bf84146d3921d75b17b9fe3ab52afb). Also a real run (cache miss).
  • Same lockfile in both runs. Both diffs add a single file under docs/requirements/ — nothing that can change type resolution.

Root cause hypothesis

pnpm-lock.yaml legitimately contains two @types/react majors: @types/[email protected] (10 refs, pulled by transitive deps) and @types/[email protected] (declared by apps/web as ^19.0.0). The CI install is pnpm install --frozen-lockfile --prefer-offline from a baked store. Under load, hoisting/resolution nondeterministically lets the 18.x types win for apps/web's typecheck, producing the ReactPortal/children mismatch (React 18 vs 19 type shape).

Suggested fixes (either closes the class)

  1. Add a pnpm override pinning @types/react (and @types/react-dom) to the 19.x version workspace-wide, so only one major exists in the resolution graph.
  2. Or scope the 18.x consumers with packageExtensions/peerDependencyRules so their types never hoist into apps/web.

Impact

Red pipelines on unrelated PRs; each occurrence costs a full CI re-run (~4h queue under current load). Observed on 2870 (2026-08-27).

## Summary CI typecheck fails nondeterministically with mass TS2786 errors ("'X' cannot be used as a JSX component ... Property 'children' is missing in type 'ReactPortal'") across `apps/web`, on diffs that cannot cause it (docs-only). This is a distinct flake class from #1448 (SPA spec timeouts) and #1349 (slow-node test timing). ## Evidence - Pipeline 2869 (branch `contract/custody-schema`, head `f8ac64f5`, docs-only diff vs `next`): typecheck PASS. Real run — turbo cache-miss lines present in the log. - Pipeline 2870 (branch `contract/onboarding-wizard`, head `3824fc6a`, docs-only diff vs `next`): typecheck FAIL with mass TS2786, minutes later on the same base (`a3b0770205bf84146d3921d75b17b9fe3ab52afb`). Also a real run (cache miss). - Same lockfile in both runs. Both diffs add a single file under `docs/requirements/` — nothing that can change type resolution. ## Root cause hypothesis `pnpm-lock.yaml` legitimately contains two `@types/react` majors: `@types/[email protected]` (10 refs, pulled by transitive deps) and `@types/[email protected]` (declared by `apps/web` as `^19.0.0`). The CI install is `pnpm install --frozen-lockfile --prefer-offline` from a baked store. Under load, hoisting/resolution nondeterministically lets the 18.x types win for `apps/web`'s typecheck, producing the ReactPortal/children mismatch (React 18 vs 19 type shape). ## Suggested fixes (either closes the class) 1. Add a pnpm override pinning `@types/react` (and `@types/react-dom`) to the 19.x version workspace-wide, so only one major exists in the resolution graph. 2. Or scope the 18.x consumers with `packageExtensions`/`peerDependencyRules` so their types never hoist into `apps/web`. ## Impact Red pipelines on unrelated PRs; each occurrence costs a full CI re-run (~4h queue under current load). Observed on 2870 (2026-08-27).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mosaicstack/stack#1449