ISR - await props.searchParams
with generateStaticParams with an empty array is causing a page error in prod mode
#79465
Labels
Dynamic Routes
Related to dynamic routes.
Link to the code that reproduces this issue
https://github.com/dskiba/next.js-isr-prod-bug
To Reproduce
Current vs. Expected behavior
Current: receiving
DYNAMIC_SERVER_USAGE
errorExpected: 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 ofprops.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
The text was updated successfully, but these errors were encountered: