vercel / vercel/next.js

Next.js v16 [Pages Router] (Regression) - Incorrect props fetched from `getServerSideProps` under high parallel load

Open
#95,367 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Linking and Navigating Pages Router
Dominant language
JavaScript
Stars
142k
Forks
32.4k
Avg merge
2d 14h
Merged PRs (30d)
351

Description

Link to the code that reproduces this issue

https://github.com/exoRift/next-prop-error-repro

To Reproduce
  1. Ensure you have Bun installed (not relevant to the issue, but just how I set up the reproduction)
  2. Clone the repro
  3. Install deps with bun i
  4. Setup puppeteer with bun setup-puppeteer
  5. In one terminal, start the dev server with bun dev (this also happens in production builds)
  6. In the other terminal, run bun scan
Current vs. Expected behavior

The expected behavior is that nothing out of the ordinary happens and no error is thrown.

Current behavior is that the incorrect props are returned during some hydration instance, resulting in a HydrationError in the console:

error: Hydration failed because the server rendered text didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used:

- A server/client branch `if (typeof window !== 'undefined')`.
- Variable input such as `Date.now()` or `Math.random()` which changes each time it's called.
- Date formatting in a user's locale which doesn't match the server.
- External changing data without sending a snapshot of it along with the HTML.
- Invalid HTML tag nesting.

It can also happen if the client has a browser extension installed which messes with the HTML before React loaded.

https://react.dev/link/hydration-mismatch

  ...
    <Head>
    <AppContainer>
      <Container fn={function fn}>
        <PagesDevOverlayBridge>
          <PagesDevOverlayErrorBoundary>
            <PathnameContextProviderAdapter router={{sdc:{},sbc:{}, ...}} isAutoExport={false}>
              <Root pageProps={{foo:2}} __N_SSP={true} Component={function Comp} err={undefined} ...>
                <Comp foo={2}>
+                 2
-                 3
              ...

      at throwOnHydrationMismatch (http://localhost:3000/_next/static/chunks/node_modules_react-dom_0kla17-._.js:3186:56)
      at completeWork (http://localhost:3000/_next/static/chunks/node_modules_react-dom_0kla17-._.js:6814:36)
      at runWithFiberInDEV (http://localhost:3000/_next/static/chunks/node_modules_react-dom_0kla17-._.js:886:74)
      at completeUnitOfWork (http://localhost:3000/_next/static/chunks/node_modules_react-dom_0kla17-._.js:8959:23)
      at performUnitOfWork (http://localhost:3000/_next/static/chunks/node_modules_react-dom_0kla17-._.js:8896:28)
      at workLoopSync (http://localhost:3000/_next/static/chunks/node_modules_react-dom_0kla17-._.js:8788:40)
      at renderRootSync (http://localhost:3000/_next/static/chunks/node_modules_react-dom_0kla17-._.js:8772:13)
      at performWorkOnRoot (http://localhost:3000/_next/static/chunks/node_modules_react-dom_0kla17-._.js:8400:186)
      at performWorkOnRootViaSchedulerTask (http://localhost:3000/_next/static/chunks/node_modules_react-dom_0kla17-._.js:9534:9)
      at performWorkUntilDeadline (http://localhost:3000/_next/static/chunks/node_modules_1z0m79v._.js:1335:64)
Provide environment information
Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 25.5.0: Mon Apr 27 20:40:51 PDT 2026; root:xnu-12377.121.6~2/RELEASE_ARM64_T8112
  Available memory (MB): 24576
  Available CPU cores: 8
Binaries:
  Node: 24.0.1
  npm: 11.3.0
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 16.2.9 // Latest available version is detected (16.2.9).
  eslint-config-next: N/A
  react: 19.2.4
  react-dom: 19.2.4
  typescript: 5.9.3
Next.js Config:
  output: N/A
Which area(s) are affected? (Select all that apply)

Pages Router, Linking and Navigating

Which stage(s) are affected? (Select all that apply)

next dev (local), next start (local)

Additional context

I have a smoke testing script that goes through my app and scans for errors. I implemented it in a way that uses N parallel puppeteer pages to comb through pages, navigating via window.next.router.push(...) and listening for errors.

I recently upgraded from Next 15.3.2 to Next 16.2.9 and noticed this new error occuring on navigation.

I'm not sure what exactly causes this issue or where the error is even thrown (seeing as there's no SSR in a client-side navigtion, I'm not sure where "hydration" is even happening). All I know is that it's deterministic based on how many parallel scanners are running. I chose 4 for this repro because it was reliable. Switching the available page count to 1 will cause this error not to occur.

It's also worth noting that using Puppeteer's page.goto instead of window.next.router.push(...) will also avoid the error.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked exoRift/next-prop-error-repro and follow its bun i, bun setup-puppeteer, bun dev, and bun scan steps. Compare parallel Puppeteer pages using window.next.router.push(...) with a single page and with page.goto; done means the reproduced navigation no longer returns incorrect props or produces a hydration mismatch.

Written by the indexing model from the issue text.

Assessment

Tech stack
bun, javascript, next.js, react
Domain
backend, frontend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.