Skip to content

Inconsistent behavior for pages with generateStaticParams #84801

@mastoj

Description

@mastoj

Link to the code that reproduces this issue

https://github.com/mastoj/next16-demo/tree/static-params-bug

To Reproduce

  1. Pull down the code
  2. Build app
  3. Start app
  4. Go to /anyslug and /wat/anyslug

Current vs. Expected behavior

The expected behavior is that /anyslug and /wat/anyslug behaves the same, but they aren't. For some reason the second box on the page is streamed in every time and not part of the render on /wat/anyslug. The only difference is that /[id] has defined some routes to in generateStaticParams (https://github.com/mastoj/next16-demo/blob/46a43943bb5bfc130bafc8f042d474b06a4ee788/app/%5Bid%5D/page.tsx#L8) while I return [] on /wat/[id].

Provide environment information

❯ npx --no-install next info

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.6.0: Mon Jul 14 11:30:30 PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T6020
  Available memory (MB): 65536
  Available CPU cores: 12
Binaries:
  Node: 20.18.1
  npm: 10.8.2
  Yarn: 1.22.22
  pnpm: 10.14.0
Relevant Packages:
  next: 16.0.0-canary.2 // Latest available version is detected (16.0.0-canary.2).
  eslint-config-next: 16.0.0-beta.0
  react: 19.1.0
  react-dom: 19.1.0
  typescript: 5.9.3
Next.js Config:
  output: N/A

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

cacheComponents

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

next start (local), Vercel (Deployed)

Additional context

I have it deployed so you can check the different behavior here:

Not ok: https://next16-demo-git-static-params-bug-mastojs-projects.vercel.app/wat/anyslug
Ok: https://next16-demo-git-static-params-bug-mastojs-projects.vercel.app/anyslug

Some more context how I would like it to work with the perspective of a fairly large ecom. Ideally we would be able to have a static shell that can always be served statically. This way any link from for example google would appear instantly with the static shell. When a page have the streamed in content should merge with the static shell so the second time someone visits from google the instant load contains both the shell we have for all pages together with the static content for that specific page. This way we would avoid flickering when coming from external sources combined with an instant first time load. From the looks now we have to render the whole thing the first time --> not instant. Considering a large portion of most ecommerce traffic is from sources like google to an internal page I do think this behavior is a huge win if it is possible to achieve.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions