[PR #118] [MERGED] fix(app-router): avoid React 19 dev Flight decode crash in SSR #325

Closed
opened 2026-05-06 12:39:12 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/cloudflare/vinext/pull/118
Author: @liuxiaopai-ai
Created: 2/26/2026
Status: Merged
Merged: 3/5/2026
Merged by: @southpolesteve

Base: mainHead: fix/issue-50-react19-hooks


📝 Commits (6)

  • bc5ed34 fix(app-router): avoid React 19 dev Flight decode crash in SSR (#50)
  • 423ef4b fix(app-router): avoid React 19 dev Flight decode crash in SSR (#50)
  • de76de6 test(ecosystem): harden fixture cleanup and isolate better-auth signup data
  • e4079cc Merge branch 'main' into fix/issue-50-react19-hooks
  • 3ea9552 chore: address review nits on React 19 dev Flight decode fix
  • 31b80a5 Merge remote-tracking branch 'origin/main' into fix/issue-50-react19-hooks

📊 Changes

5 files changed (+127 additions, -17 deletions)

View changed files

📝 packages/vinext/src/server/app-dev-server.ts (+28 -3)
📝 tests/app-router.test.ts (+21 -0)
📝 tests/ecosystem.test.ts (+42 -14)
tests/fixtures/app-basic/app/react19-dev-rsc-error/error.tsx (+18 -0)
tests/fixtures/app-basic/app/react19-dev-rsc-error/page.tsx (+18 -0)

📄 Description

Summary\nFixes React 19 dev-mode App Router SSR regression where Flight error decode could crash with:\n- Invalid hook call\n- Cannot read properties of null (reading 'useContext')\n\n## Changes\n- Decode Flight stream lazily from inside a React render path in dev SSR:\n - add VinextFlightRoot wrapper and render it via createElement\n - remove the production-decoder fallback path used previously\n- Update regression test to assert crash is gone while preserving current React 19 dev behavior\n - checks client-render fallback markers\n - negative assertions for the two crash signatures above\n- Harden ecosystem fixture stability (test-only):\n - detached fixture process + process-group termination\n - randomize better-auth test emails to avoid cross-run signup collisions\n\n## Validation\n- pnpm -s run lint\n- pnpm -s run typecheck\n- pnpm -s test tests/app-router.test.ts\n- pnpm -s test tests/static-export.test.ts\n- pnpm -s test tests/ecosystem.test.ts\n- pnpm -s test (47 files, 1820 passed, 3 skipped)\n

Fixes #50


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/cloudflare/vinext/pull/118 **Author:** [@liuxiaopai-ai](https://github.com/liuxiaopai-ai) **Created:** 2/26/2026 **Status:** ✅ Merged **Merged:** 3/5/2026 **Merged by:** [@southpolesteve](https://github.com/southpolesteve) **Base:** `main` ← **Head:** `fix/issue-50-react19-hooks` --- ### 📝 Commits (6) - [`bc5ed34`](https://github.com/cloudflare/vinext/commit/bc5ed341b713fb734363ea7ca37d07398754c706) fix(app-router): avoid React 19 dev Flight decode crash in SSR (#50) - [`423ef4b`](https://github.com/cloudflare/vinext/commit/423ef4b5b4621d82ffe620163852ff7963054842) fix(app-router): avoid React 19 dev Flight decode crash in SSR (#50) - [`de76de6`](https://github.com/cloudflare/vinext/commit/de76de618d6e140777deca98ef59fccc2ac7ff63) test(ecosystem): harden fixture cleanup and isolate better-auth signup data - [`e4079cc`](https://github.com/cloudflare/vinext/commit/e4079cc22720d67b1ffc74e40b8dc128c6853df9) Merge branch 'main' into fix/issue-50-react19-hooks - [`3ea9552`](https://github.com/cloudflare/vinext/commit/3ea9552e1ff0ce1ab42cf647e814a12a9de1eff3) chore: address review nits on React 19 dev Flight decode fix - [`31b80a5`](https://github.com/cloudflare/vinext/commit/31b80a5722c04b31ef6a592504b6d3d2449bef67) Merge remote-tracking branch 'origin/main' into fix/issue-50-react19-hooks ### 📊 Changes **5 files changed** (+127 additions, -17 deletions) <details> <summary>View changed files</summary> 📝 `packages/vinext/src/server/app-dev-server.ts` (+28 -3) 📝 `tests/app-router.test.ts` (+21 -0) 📝 `tests/ecosystem.test.ts` (+42 -14) ➕ `tests/fixtures/app-basic/app/react19-dev-rsc-error/error.tsx` (+18 -0) ➕ `tests/fixtures/app-basic/app/react19-dev-rsc-error/page.tsx` (+18 -0) </details> ### 📄 Description ## Summary\nFixes React 19 dev-mode App Router SSR regression where Flight error decode could crash with:\n- `Invalid hook call`\n- `Cannot read properties of null (reading 'useContext')`\n\n## Changes\n- Decode Flight stream lazily from inside a React render path in dev SSR:\n - add `VinextFlightRoot` wrapper and render it via `createElement`\n - remove the production-decoder fallback path used previously\n- Update regression test to assert crash is gone while preserving current React 19 dev behavior\n - checks client-render fallback markers\n - negative assertions for the two crash signatures above\n- Harden ecosystem fixture stability (test-only):\n - detached fixture process + process-group termination\n - randomize better-auth test emails to avoid cross-run signup collisions\n\n## Validation\n- `pnpm -s run lint`\n- `pnpm -s run typecheck`\n- `pnpm -s test tests/app-router.test.ts`\n- `pnpm -s test tests/static-export.test.ts`\n- `pnpm -s test tests/ecosystem.test.ts`\n- `pnpm -s test` (47 files, 1820 passed, 3 skipped)\n Fixes #50 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-06 12:39:12 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vinext#325
No description provided.