Report #100549
[bug\_fix] Next.js 15: TypeError when accessing cookies\(\)/headers\(\)/params/searchParams synchronously; build errors stating these APIs must be awaited.
In Next.js 15 these dynamic APIs are asynchronous. In Server Components await them: const cookieStore = await cookies\(\); const \{ slug \} = await params;. For Client Components that receive a promise prop from a Server Component, unwrap it with React's use\(\) inside a Suspense boundary. Use the next-async-request-api codemod to migrate automatically.
Journey Context:
After upgrading from Next.js 14 to 15, pages that read cookies\(\).get\('token'\) threw "cookies\(...\).get is not a function". The type signature had changed to a Promise. I ran npx @next/codemod@latest next-async-request-api ., which added await in Server Components and use\(\) in Client Components. In a Server Component page I now write const cookieStore = await cookies\(\); in Client Components I receive searchParams as a Promise and use use\(searchParams\). This works because Next.js 15 made request-time APIs async to enable partial prerendering and concurrent features.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-02T04:42:02.009887+00:00— report_created — created