Skip to main content
GoodFirstPicks
DashboardIssuesReposLeaderboard

GoodFirstPicks by Leaveitblank © 2026

CreatorRequest a RepoPrivacy PolicyTerms of Service
Route "/" did not produce a static shell and Next.js was unable to determine a reason. This is a bug in Next.js. | GoodFirstPicks

Route "/" did not produce a static shell and Next.js was unable to determine a reason. This is a bug in Next.js.

vercel/next.js 2 comments 6d ago
View on GitHub
mediumopenScope: somewhat clearSkill match: maybeNext.jsTypeScriptReact

Why this is a good first issue

Next.js incorrectly handles runtime data in `generateMetadata` with `cacheComponents` enabled.

AI Summary

The issue occurs when `generateMetadata` uses runtime data (e.g., `await connection()`) and `cacheComponents: true` is enabled, causing Next.js to fail in determining the reason for an empty static shell. The fix likely involves detecting dynamic metadata when the prelude is empty in static shell validation. A maintainer suggests this issue might be resolved in version 16.2.1, but confirmation is needed.

Issue Description

Link to the code that reproduces this issue

https://github.com/IskanderMustafin/nextjs-metadata-runtime-bug

To Reproduce

  1. Create a new app: pnpm create next-app@latest next-runtime-data-test --yes
  2. In next.config.ts, set:
     cacheComponents: true,
     htmlLimitedBots: /.*/,

  1. In app/page.tsx add generateMetadata that accesses runtime data (like await searchParams or await connection()) :
   export async function generateMetadata(): Promise<Metadata> {
     await connection()

     return {
       title: 'My App',
       description: 'My App Description',
     }
   }

  1. Run pnpm dev and open / in the browser.
Image Image

Current vs. Expected behavior

In the dev server logs, Next.js repeatedly prints:

Route "/" did not produce a static shell and Next.js was unable to determine a reason. This is a bug in Next.js.

generateMetadata should be allowed to use runtime data like connection() even when cacheComponents: true and htmlLimitedBots: /.*/ are enabled.

Provide environment information

npx --no-install next info

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 25.1.0: Mon Oct 20 19:34:05 PDT 2025; root:xnu-12377.41.6~2/RELEASE_ARM64_T6041
  Available memory (MB): 24576
  Available CPU cores: 12
Binaries:
  Node: 20.19.4
  npm: 10.8.2
  Yarn: N/A
  pnpm: 10.14.0
Relevant Packages:
  next: 16.0.5 // Latest available version is detected (16.0.5).
  eslint-config-next: N/A
  react: 19.2.0
  react-dom: 19.2.0
  typescript: 5.9.3
Next.js Config:
  output: N/A

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

create-next-app, Metadata, cacheComponents

Which stage(s) are affected? (Se

GitHub Labels

create-next-appMetadataCache Components

Want to work on this?

Claim this issue to let others know you're working on it. You'll earn 20 points when you complete it!

Risk Flags

  • potential caching issues
  • metadata handling
Loading labels...

Details

Points20 pts
Difficultymedium
Scopesomewhat clear
Skill Matchmaybe
Test Focusedno