vercel / vercel/next.js

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

Open
#86,664 3 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Cache Components create-next-app Metadata
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/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? (Select all that apply)

next dev (local), next build (local), next start (local)

Additional context

The issue only appears when all three are combined:

  • cacheComponents: true
  • htmlLimitedBots: /.*/ (disabling streaming metadata)
  • generateMetadata calling any runtime data ( e.g. await connection())

Problem happens with any Next.js 16+ (I tried up until 16.0.5)

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

Reproduce the warning with next.config.ts and app/page.tsx, using generateMetadata with connection(), then compare behavior under pnpm dev, next build, and next start. Trace the handling of runtime metadata with cacheComponents and htmlLimitedBots; done means the route renders its metadata without repeated static-shell warnings in the reported configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
next.js, react, typescript
Domain
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.