# `DynamicServerError: Dynamic server usage: Route /… couldn't be rendered statically because it used `cookies` or `headers`.`

**Where it appears:** Vercel build logs or terminal

**What it means:** Next.js tried to pre-build a page as fixed HTML at build time, but the page reads the current visitor's session cookies or request headers.

## Likely causes

- A page that checks the Better Auth session was marked as force-static or called inside a static route.
- Reading `cookies()` or `headers()` inside a route or helper that Next.js expected to prerender at build time.

## Message for your agent

```text
The build shows `DynamicServerError: Dynamic server usage`. Check why that route is being statically prerendered while reading cookies/headers and configure the route or Suspense boundary properly.
```

**Prevention:** Wrap personalized or session-dependent sections in `<Suspense>` or let authenticated pages render dynamically.

---
Source: [Agentic Makers](https://agenticmakers.app/en/help/errors/dynamic-server-usage-cookies-headers) · License: CC BY 4.0
