Async Request APIs
Next.js 16 finishes a migration that began in version 15: the Request APIs are
now asynchronous, and the synchronous access is fully removed. In page.tsx,
layout.tsx, and route.ts, params and searchParams are Promises, and
cookies() and headers() return Promises too.
Await them before you read anything:
// app/blog/[slug]/page.tsx
export default async function Page({ params, searchParams }) {
const { slug } = await params;
const query = await searchParams;
return <h1>Blog Post: {slug}</h1>;
}
The same rule applies to the dynamic APIs:
import { cookies, headers } from 'next/headers';
export default async function Page() {
const cookieStore = await cookies();
const headerList = await headers();
const theme = cookieStore.get('theme')?.value;
return <p>{theme}</p>;
}
Because these values arrive asynchronously, the component that reads them must
be async — and reading request data like this opts the route into dynamic
rendering. The next-async-request-api codemod rewrites synchronous calls, and
npx next typegen generates the PageProps and LayoutProps helpers so
await props.params stays type-safe.
If you forget the await, you get a Promise instead of the value, so
destructuring silently fails. Treat every one of these APIs as await-first.
You are about to answer a short quiz on await params / cookies() /
headers().