Next.js Discord

Discord Forum

```const dynamicParams = false``` is not working when enabling `cacheComponents` in Next.js

Unanswered
Northern snakehead posted this in #help-forum
Open in Discord
Northern snakeheadOP
## Error Type
Build Error

## Error Message
Ecmascript file had an error

## Build Output
./src/app/posts/[postId]/page.tsx:18:14
Ecmascript file had an error
16 | type Posts = Post[]
17 |
18 | export const dynamicParams = false
| ^^^^^^^^^^^^^
19 |
20 | async function getPost(id: string): Promise<Post> {
21 | 'use cache'

Route segment config "dynamicParams" is not compatible with nextConfig.experimental.cacheComponents. Please remove it.

Next.js version: 15.4.2-canary.48 (Turbopack)

1 Reply

I am pretty sure that with experimental.cacheComponents enabled, route segment config options like dynamicParams are disabled. I haven't confirmed this, but if it is accurate than this error is expected