-
Notifications
You must be signed in to change notification settings - Fork 28.9k
Closed
Labels
Description
Link to the code that reproduces this issue
https://github.com/dskiba/next.js-isr-prod-bug
To Reproduce
- run yarn install && yarn run build && yarn run start
- go to any slug page; example - http://localhost:3000/1
- 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