Skip to main content
Next.js & React · Developer Error Resolution Lab

Fix Next.js 15/16 Error: 'Route used params.slug. params should be awaited before using its properties'

Resolve Next.js 15 and 16 asynchronous Dynamic API errors where `params`, `searchParams`, `cookies()`, and `headers()` return Promises.

Triggered Error Message:

Error: Route "/posts/[slug]" used `params.slug`. `params` should be awaited before using its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis

Customize Solution for Your Environment
// Server Component (page.tsx / layout.tsx / route.ts):
export default async function Page({
  params,
}: {
  params: Promise<{ slug: string }>;
}) {
  const { slug } = await params;
  return <div>{slug}</div>;
}

// Or run the official Next.js codemod automatically:
// npx @next/codemod@canary next-async-request-api .

Root Cause & Mechanism Analysis

Why does this error occur?

Starting in Next.js 15 and enforced strictly in Next.js 16, route `params`, `searchParams`, `cookies()`, `headers()`, and `draftMode()` are asynchronous Promises to allow partial prerendering (PPR) and streaming before request-specific data is resolved.

Frequently Asked Questions

How do I read async params inside a 'use client' component?
In a Client Component, import `use` from `react` and call `const { slug } = use(params);`.
DEVSECOPS & CI/CD PARTNER2 Slots Open

Need Zero-Knowledge .env Secret Sync Across Your Engineering Team?

Explore Castov Env Vault for client-side AES-256-GCM encrypted environment sharing, or sponsor this engineering hub.

Browse All 54 Guides