loading entry…
loading entry…
Build fails or static prerender warns: cookies() called outside of a request scope when the component is statically prerendered.
In Next.js 16 with Cache Components enabled, cookies() is a dynamic API. A Server Component that reads cookies must be inside a <Suspense> boundary so the surrounding route can prerender its static shell.
Wrap the component (not the page) in a <Suspense> boundary:
<Suspense fallback={<Skeleton />}>
<ComponentThatReadsCookies />
</Suspense>
The fallback renders at build time; the cookie-reading component streams at request time.
~/.claude/playbooks/nextjs16-vercel-deployment.md