8000 ISR - `await props.searchParams` with generateStaticParams with an empty array is causing a page error in prod mode · Issue #79465 · vercel/next.js · GitHub
[go: up one dir, main page]

Skip to content
ISR - await props.searchParams with generateStaticParams with an empty array is causing a page error in prod mode #79465
@dskiba

Description

@dskiba

Link to the code that reproduces this issue

https://github.com/dskiba/next.js-isr-prod-bug

To Reproduce

  1. run yarn install && yarn run build && yarn run start
  2. go to any slug page; example - http://localhost:3000/1
  3. see error 500 page and error in terminal
⨯ [Error: An error occurred in the Server Components render. The specific message is omitted in production builds to avoid leaking sensitive details. A digest property is included on this error instance which may provide additional details about the nature of the error.] {
  digest: 'DYNAMIC_SERVER_USAGE'

Current vs. Expected behavior

Current: receiving DYNAMIC_SERVER_USAGE error

Expected: searchParams should be empty

Provide environment information

perating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.4.0: Fri Apr 11 18:33:47 PDT 2025; root:xnu-11417.101.15~117/RELEASE_ARM64_T6000
  Available memory (MB): 16384
  Available CPU cores: 8
Binaries:
  Node: 21.6.2
  npm: 8.9.0
  Yarn: 1.22.17
  pnpm: 9.8.0
Relevant Packages:
  next: 15.4.0-canary.45 // Latest available version is detected (15.4.0-canary.45).
  eslint-config-next: N/A
  react: 19.1.0
  react-dom: 19.1.0
  typescript: 5.8.3
Next.js Config:
  output: N/A

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

Dynamic Routes

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

next build (local)

Additional context

Many hours later, I've found out that it is caused by a combination of generateStaticParams with an empty array and the async call of props.searchParams.

So, in dev mode,
OR with export const dynamic = 'force-static' instead of generateStaticParams with an empty array,
OR not accessing async searchParams
will work fine

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0