Partial Prefetching: generated routes return HTTP 500 on a cold custom-cache miss
Link to the code that reproduces this issue
https://github.com/krzkz94/nextjs-partial-prefetch-cache-miss-repro
To Reproduce
- Clone the reproduction and install its pinned dependencies:
git clone https://github.com/krzkz94/nextjs-partial-prefetch-cache-miss-repro.git
cd nextjs-partial-prefetch-cache-miss-repro
npm ci
npm test
The script builds the app successfully, starts a fresh production server, and requests
/enand/fr. Both paths are returned bygenerateStaticParams().Observe HTTP 500 for both generated routes. The test exits with status 1 because it expects HTTP 200.
Build logs, server logs, and JSON results are saved under artifacts/<next-version>/<mode>-<bundler>/.
To reproduce with Turbopack:
npm run test:turbopack
Run these controls sequentially:
npm run test:filesystem
npm run test:prefetch-off
Both controls return HTTP 200.
Current vs. Expected behavior
Current:
The production build succeeds and generates /en and /fr, but the first requests to those routes return HTTP 500 when all of the following are configured:
cacheComponents: truepartialPrefetching: true- A custom incremental cache handler that initially returns
null cacheMaxMemorySize: 0
The server trace shows the concrete route missing, followed by a generic fallback-shell miss:
[cache.get] {"key":"/en","kind":"APP_PAGE","isFallback":false,"hit":false}
[cache.get] {"key":"/[locale]","kind":"APP_PAGE","isFallback":true,"hit":false}
Error: Route "/[locale]": Next.js encountered uncached or runtime data during prerendering.
code: 'NEXT_STATIC_GEN_BAILOUT'
Expected:
/en should return HTTP 200 with Locale: en, and /fr should return HTTP 200 with Locale: fr. A cache miss should allow these generated routes to render successfully.
The page only awaits params and renders the locale. It performs no data fetching.
Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 27.0.0: Tue Aug 11 21:05:48 PDT 2026; root:xnu-13432.1.9~1/RELEASE_ARM64_T6041
Available memory (MB): 65536
Available CPU cores: 16
Binaries:
Node: 24.11.1
npm: 11.6.2
Yarn: N/A
pnpm: 8.15.9
Relevant Packages:
next: 16.4.0-canary.33
eslint-config-next: N/A
react: 19.2.0
react-dom: 19.2.0
typescript: N/A
Next.js Config:
output: N/A
Which area(s) are affected? (Select all that apply)
cacheComponents, Dynamic Routes, Partial Prerendering (PPR), Runtime
Which stage(s) are affected? (Select all that apply)
next start (local)
Additional context
Verified results:
- Next.js 16.3.5 with webpack: build succeeds; both generated routes return 500.
- Next.js 16.4.0-canary.33 with webpack and Turbopack: build succeeds; both generated routes return 500.
- Using Next's default filesystem cache, while retaining partial prefetching and
cacheMaxMemorySize: 0: both routes return 200. - Keeping the custom cache but disabling partial prefetching: both routes return 200.
The reproduction uses only Next.js, React, and React DOM. The custom cache is a small in-memory Map. There is no Redis, external service, third-party cache library, authentication, or dependency patch.
The trace suggests investigating the handling of the generic /[locale] fallback shell during runtime regeneration versus build-time shell validation. The repository demonstrates the behavior without bundling or prescribing a particular fix.
Source: vercel/next.js