Skip to content

A React bug logs a false hydration error (React error 418) on pages with long lists #1018

Open

Description

@richshaw

Needs your OK: this is waiting on a Next upgrade whose bundled React has the fix. Nothing people see changes. Swap pipeline:proposed for pipeline:ready once you've picked an option below and want it built.

What happens

  • The symptom. The e2e test "signing out" in tests/e2e/root-layouts.spec.ts ("lands on the home page, and /app then asks to sign in") fails now and then with Minified React error #418 (args[]=HTML), a hydration error. The test collects console errors and expects none.
  • It isn't about signing out. The trace shows the error comes while page.goto('/app') hydrates Your signups, before the Sign out click.
  • How often:
    • alone, with the reseed's 8 signups: 0 of 120 runs;
    • with the seeded organizer at about 60 signups, as partway through a full e2e run, with --workers=2 on a loaded machine: 7 of 60 (about 12%).
  • Seen before in this project:
  • Who it affects. Nobody sees a broken page: React recovers by rendering that part again in the browser. The cost is a flaky CI job, an error in the console, and a wasted client re-render on the pages with the longest lists.

Why

  • It's a bug in the React that Next bundles: Bug: A tree hydrated but some attributes of the server rendered HTML didn't match the client properties. react/react#35210.
  • What goes wrong. When hydration starts before the browser has read all of the page's inline data, a <ul> waits for a list item that hasn't arrived yet. React then retries the <ul> without moving back its place in the server HTML, so it compares the wrong nodes and reports a mismatch that isn't there.
  • Why long lists. Your signups is one <ul> with an <li> per signup (src/app/(organizer)/app/(chrome)/page.tsx), and a public signup is one <ul> of slots (src/app/s/[slug]/signup-view.tsx). More items and a busier machine make the gap more likely.
  • The upstream fix. [Fiber] Correctly handle replaying when hydrating react/react#35494, merged on 13 January 2026, released in React 19.3.
  • Where we are. main uses Next 15.5.29, which bundles React 19.2.0-canary-0bdb9206-20250818, from before the fix. 15.5.29 is the newest 15.x (npm's backport tag), so no 15.x release has the fix.
  • Where the fix is. Next 16.4.6, npm's latest today, bundles React 19.3.0-canary-278794d7-20261002, built well after the fix landed.
  • The react pin doesn't decide this. App Router pages run the copy bundled inside Next (next/dist/compiled/react-dom), not the react and react-dom in package.json.

Evidence

  • The fix makes it go away. With React's fix patched into the built JavaScript, as a local test only and not committed, the same loop failed 0 of 60 under the same load, against 7 of 60 without it.
  • How to reproduce:
    1. Postgres up, migrations applied, then pnpm build.
    2. A scratch Playwright config whose globalSetup runs the normal reseed (seedE2E and clearSignInRateLimits from tests/e2e/helpers/seed.ts), then gives the seeded organizer about 55 more signups through createSignup, publishing every other one with one slot. That's roughly what a full e2e run leaves them with.
    3. Run the test many times with two workers, on a loaded machine, clearing rate_limits between batches:
      pnpm exec playwright test -c playwright.flake.config.ts tests/e2e/root-layouts.spec.ts \
        -g 'signing out' --project=chromium --repeat-each=30 --workers=2 --trace retain-on-failure
    4. Expect a few failures in 60, each Minified React error #418 with args[]=HTML, logged while /app hydrates.

Fix, in outline

Two ways to get React's fix:

  1. Upgrade Next to a 16.x release whose bundled React has it. 16.4.6 does. It's a major upgrade with its own breaking changes, so it's a PR of its own, and a high-risk one under the pipeline's rules (a dependency's major version).
  2. pnpm patch Next's bundled react-dom with the upstream fix. Small, but it's a patch on minified vendor code. It pins the exact Next version, and has to be dropped or redone on every Next update.

Choices this makes

  • Wait, then option 1. The owner chose to leave the code alone until a Next release with the fixed React is taken on. No 15.x release will have it, so in practice that's the Next 16 upgrade.

Watch for

  • Until then, a test that fails with React error 418 (args[]=HTML) under load is this bug, not the test. Don't loosen the "no console errors" check or add retries to hide it.
  • Page "Your signups" so every signup in a workspace can be reached #871 pages Your signups. Shorter lists on /app may make the sign-out test flake less there, but long signup pages keep the bug.
  • A Next major upgrade moves more than this. Read its upgrade guide, and check the page JavaScript against budgets.json after pnpm build: raising a budget goes to the owner.

Done when

  • The app runs a React with [Fiber] Correctly handle replaying when hydrating react/react#35494 in it: the version string in node_modules/next/dist/compiled/react-dom/cjs/react-dom-client.production.js is a 19.3 canary built after 13 January 2026, or the patch is applied.
  • The repro above fails 0 of 60 where it failed about 7 of 60 before.
  • pnpm lint && pnpm format:check && pnpm typecheck && pnpm knip && pnpm test, pnpm test:db, pnpm build && pnpm budgets and pnpm test:e2e pass.

From an investigation of the flaky "signing out" e2e test, checked against main at be771ff (Next 15.5.29). Checked by repeated runs of that test with and without React's fix patched in, and by reading the React version each Next release bundles. https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt

Activity

  1. added
    bug
    on Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpipeline:proposed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions