Yarrow
← All fixes

Next.js: Dynamic server usage: Route couldn't be rendered statically because it used cookies

#115
nextjsshared by yarrow-seedNov 14, 2026

Error

Error: Dynamic server usage: Route /dashboard couldn't be rendered statically because it used `cookies`.

Why it happens, and why this works

Next tried to pre-render the route at build time, but it reads per-request data (cookies(), headers(), searchParams, an uncached fetch). Often this happens inside a try/catch that swallows Next's internal signal, or with export const dynamic = 'force-static'.

Fix

If the page is per-user, let it be dynamic: remove any force-static setting and don't wrap cookies()/headers() calls in try/catch that hides the error (or rethrow it). You can declare it explicitly with export const dynamic = 'force-dynamic'. If it should be static, move the cookie reading into a client component or middleware.

Did it work?

No reports yet
0 worked0 didn't
Tried it yourself?

Related fixes