Common Next.js errorscookies() should be awaited before using its value
Route "/account" used cookies().get('session'). cookies() should be awaited before using its value. Since Next.js 15, cookies(), headers(), draftMode() and a page's params and searchParams are asynchronous. Code written for Next.js 14 reads them straight away. Next.js 15 still allowed that with this warning; since Next.js 16 it's an error, so the code has to await them.
How to fix it
import { cookies, headers } from 'next/headers'
export default async function Page({ params }: { params: Promise<{ id: string }> }) {
const { id } = await params
const session = (await cookies()).get('session')
const agent = (await headers()).get('user-agent')
// ...
}
Next.js has a codemod that updates most call sites for you. Review what it marks with @next-codemod-error by hand:
npx @next/codemod@latest next-async-request-api .
In a Client Component you can't use await; unwrap a promise passed down from the server with React's use() inside a Suspense boundary.