Link to the code that reproduces this issue
https://github.com/skurekjakub/next-unlisted-params-repro
To Reproduce
- npm install && npm run repro
Current vs. Expected behavior
Current
app/post/[slug]/page.tsx has a generateStaticParams that returns the complete list of slugs, and calls notFound() for anything else. With cacheComponents: true, every request for a slug that isn't on the list renders a 404 and then stores that 404 under its own path in the ISR store.
Since the possible param space is unbounded disk grows based on you cacheLife config for the route * number of 404 requests in that time interval - which for some legacy domains that have changed urls many times and have their stuff on botlists and god knows what can be a lot.
Expected
I expect some way to close the gap and give the runtime info that generateStaticParams is exhaustive (build-time known invariant) under cacheComponents and partialPrefetching without converting the route fully static.
I'm not sure if this is a bug or intended behavior, since workarounds such as proxy-level middleware can short-circuit and redirect to /_not-found as well, but its extra code and kind of cumebrsome?
Provide environment information
Operating System:
Platform: linux
Arch: arm64
Version: #1 SMP PREEMPT_DYNAMIC Thu Jun 18 21:38:49 UTC 2026
Available memory (MB): 15762
Available CPU cores: 18
Binaries:
Node: 24.19.0
npm: 11.17.0
Yarn: N/A
pnpm: N/A
Relevant Packages:
next: 16.3.3 // Latest available version is detected (16.3.3).
eslint-config-next: N/A
react: 19.2.6
react-dom: 19.2.6
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)
Other (Deployed)
Additional context
No response
Link to the code that reproduces this issue
https://github.com/skurekjakub/next-unlisted-params-repro
To Reproduce
Current vs. Expected behavior
Current
app/post/[slug]/page.tsx has a
generateStaticParamsthat returns the complete list of slugs, and callsnotFound()for anything else. With cacheComponents: true, every request for a slug that isn't on the list renders a 404 and then stores that 404 under its own path in the ISR store.Since the possible param space is unbounded disk grows based on you
cacheLifeconfig for the route * number of 404 requests in that time interval - which for some legacy domains that have changed urls many times and have their stuff on botlists and god knows what can be a lot.Expected
I expect some way to close the gap and give the runtime info that
generateStaticParamsis exhaustive (build-time known invariant) under cacheComponents and partialPrefetching without converting the route fully static.I'm not sure if this is a bug or intended behavior, since workarounds such as proxy-level middleware can short-circuit and redirect to /_not-found as well, but its extra code and kind of cumebrsome?
Provide environment information
Operating System: Platform: linux Arch: arm64 Version: #1 SMP PREEMPT_DYNAMIC Thu Jun 18 21:38:49 UTC 2026 Available memory (MB): 15762 Available CPU cores: 18 Binaries: Node: 24.19.0 npm: 11.17.0 Yarn: N/A pnpm: N/A Relevant Packages: next: 16.3.3 // Latest available version is detected (16.3.3). eslint-config-next: N/A react: 19.2.6 react-dom: 19.2.6 typescript: 5.9.3 Next.js Config: output: N/AWhich area(s) are affected? (Select all that apply)
cacheComponents
Which stage(s) are affected? (Select all that apply)
Other (Deployed)
Additional context
No response