Skip to content

fix: guard missing React ViewTransition#467

Draft
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/critical-bug-investigation-7e08
Draft

fix: guard missing React ViewTransition#467
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/critical-bug-investigation-7e08

Conversation

@cursor

@cursor cursor Bot commented Jul 14, 2026

Copy link
Copy Markdown

Bug and impact

React 19.2.7 in the installed runtime does not export ViewTransition (typeof React.ViewTransition === "undefined"). The past-paper grid rendered <ViewTransition> unconditionally around every paper card, so opening a past-paper listing could crash with React's invalid element type error instead of showing papers.

A separate setup regression also made pnpm install --frozen-lockfile --prefer-offline fail under pnpm 11 because package.json#pnpm.overrides is ignored while the lockfile still recorded those overrides.

Root cause

  • The global page transition was gated by an env flag, but the card-level past-paper transition still assumed React's experimental ViewTransition component exists at runtime.
  • pnpm override configuration was split between an ignored package.json#pnpm block and active pnpm-workspace.yaml overrides, leaving the lockfile out of sync with pnpm 11's active config.

Fix

  • Only render React ViewTransition wrappers when typeof ViewTransition === "function"; otherwise render children directly.
  • Add the same runtime export check to the opt-in global transition gate.
  • Move the stale pnpm overrides into pnpm-workspace.yaml, sync pnpm-lock.yaml, and explicitly deny nonessential optional postinstall scripts that broke frozen install in the cloud image.

Validation

  • corepack pnpm install --frozen-lockfile --prefer-offline
  • corepack pnpm exec tsx scripts/test-global-error-reload-guard.ts
  • corepack pnpm exec tsx scripts/test-pdf-download-page-edits.ts
  • corepack pnpm --filter examcooker typecheck
  • Targeted render probe for CoursePaperGrid with placeholder env: grid render ok

Note: corepack pnpm exec tsc --noEmit --pretty false still fails on pre-existing SVG/generated JSON module declarations, as recorded in repo automation memory; no new errors from these changes were observed.

Open in Web View Automation 

spent a lot of water and tokens to review your slop

Greptile Summary

This PR prevents crashes when React does not export ViewTransition and aligns pnpm installation settings. The main changes are:

  • Guard global and card-level transitions with a runtime export check.
  • Render paper cards directly when the transition component is unavailable.
  • Move pnpm overrides into the workspace configuration.
  • Synchronize lockfile overrides and optional build-script policy.

Confidence Score: 5/5

This looks safe to merge.

The optional React export is checked before either component renders it. The keyed wrapper preserves paper-card reconciliation in the fallback path. The workspace and lockfile override declarations match. No blocking issue was found in the changed code.

T-Rex T-Rex Logs

What T-Rex did

  • Verified the installed repository dependency indicates React.version 19.2.7 and that React.ViewTransition is undefined.
  • Inspected the code paths and confirmed that CoursePaperGrid's PaperCardTransition returns children directly unless ViewTransition is a function, and that DirectionalTransition applies the same availability check in its opt-in gate.
  • Confirmed that execution halted before a real application route or repository-native component harness rendered a paper card, so no visual render was produced.
  • Concluded that the current evidence does not include a visual/run-time render proof.

T-Rex Ran code and verified through T-Rex

Important Files Changed

Filename Overview
app/components/common/directional-transition.tsx Adds a runtime capability check to the existing opt-in page transition gate.
app/components/past_papers/course-paper-grid.tsx Adds a safe wrapper that renders cards without ViewTransition when the React export is unavailable.
package.json Removes the inactive package-level pnpm override configuration.
pnpm-workspace.yaml Centralizes dependency overrides and configures dependency build-script permissions.
pnpm-lock.yaml Synchronizes lockfile override metadata with the workspace configuration.

Reviews (1): Last reviewed commit: "fix: guard missing React ViewTransition" | Re-trigger Greptile

cursoragent and others added 2 commits July 14, 2026 11:11
Co-authored-by: theg1239 <theg1239@users.noreply.github.com>
Co-authored-by: theg1239 <theg1239@users.noreply.github.com>
@vercel

vercel Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
examcooker-dev Error Error Jul 14, 2026 11:13am

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.

1 participant