Next.js: params should be awaited before using its properties
Error: Route "/blog/[slug]" used `params.slug`. `params` should be awaited before using its properties.In one sentence: Since Next.js 15, params and searchParams in pages, layouts and route handlers are Promises, so you have to await them before reading a value.
What it means
In Next.js 15 the request-based APIs became async: `params`, `searchParams`, `cookies()`, `headers()` and `draftMode()`. Old code (and a lot of AI-generated code trained on Next.js 14) reads `params.slug` directly, which triggers this warning in dev and can break the build.
A related build error is `Type '{ params: { slug: string; } }' does not satisfy the constraint 'PageProps'`. It's the same problem: the type says `params` is a plain object, but Next.js now passes a Promise.
Common causes
- A page, layout or `generateMetadata` reads `params.slug` without `await`.
- Props are typed as `{ params: { slug: string } }` instead of `{ params: Promise<{ slug: string }> }`.
- A route handler (`app/api/.../route.ts`) uses the second argument's `params` synchronously.
- `cookies()` or `headers()` is called without `await`.
How to fix it
- Make the component `async`, type params as a Promise, and destructure after awaiting: `const { slug } = await params;`.
- Do the same in `generateMetadata` and in route handlers: `export async function GET(req: Request, { params }: { params: Promise<{ id: string }> })`.
- In a Client Component, either unwrap with React's `use(params)` or skip props and call `useParams()` from `next/navigation`.
- For a big project, run the official codemod: `npx @next/codemod@canary next-async-request-api .`, then review the diff.
Before
export default function Post({ params }: { params: { slug: string } }) {
return <h1>{params.slug}</h1>;
}After
export default async function Post({ params }: { params: Promise<{ slug: string }> }) {
const { slug } = await params;
return <h1>{slug}</h1>;
}Tried this and it's still broken? Paste your exact error for a free explanation of your specific case.
Prompt to paste into your AI tool
Next.js 15 says 'params should be awaited before using its properties'. Update every page, layout, generateMetadata and route handler that reads params or searchParams so they are typed as Promises and awaited (or use use()/useParams() in client components). Also await cookies() and headers(). Don't change unrelated code.Still stuck?
Paste your exact error and code. Get a plain-English explanation free, or the full fix for $5.
Hitting errors every day? Builder is $15/mo for 100 fixes per month. Compare plans
Related errors
- Error: supabaseUrl is required
- Error: NEXT_REDIRECT
- TypeScript: Type 'string | undefined' is not assignable to type 'string'
- git push rejected: failed to push some refs
Weekly: the errors breaking vibe-coded apps and how to fix them. Free.
No spam. Unsubscribe anytime.