Next.js 15: Route used params, params should be awaited
In Next.js 15 params, searchParams, cookies and headers are Promises. Await them in pages, layouts, metadata and route handlers, then fix the types.

Introduction & Quick Summary
After upgrading to Next.js 15, a dynamic route that worked for months throws on the first request:
Error: Route "/blog/[slug]" used `params.slug`. `params` should be awaited
before using its properties.
Learn more: https://nextjs.org/docs/messages/sync-dynamic-apisQuick answer: params, searchParams, cookies(), headers() and draftMode() are Promises in Next.js 15. Await them, and type them as Promises.
// app/blog/[slug]/page.tsx
export default async function Page({
params,
}: {
params: Promise<{ slug: string }>;
}) {
const { slug } = await params;
const post = await getPost(slug);
return <article>{post.title}</article>;
}Two separate failures are reported with almost the same words, and they need different fixes. The runtime error above comes from reading a property on the Promise object (params.slug is undefined). The build error comes from the type: Type '{ params: { slug: string } }' does not satisfy the constraint 'PageProps' because the framework now declares params as Promise<{ slug: string }>. Fixing the type without the await leaves a page that compiles and renders undefined.
The change exists for partial prerendering and streaming: the framework can start rendering before the request's dynamic values are known. That is also why the value arrives as a Promise rather than a plain object — every consumer must opt in to waiting.
Core Mechanics, Signatures & Reproducible Setup
Reproduce with the official codemod disabled, so the failure is visible:
npx create-next-app@latest next15-async --ts --app --no-tailwind --no-eslint
cd next15-async
mkdir -p app/blog/\[slug\]
cat > app/blog/\[slug\]/page.tsx <<'TSX'
export default function Page({ params }: { params: { slug: string } }) {
return <h1>{params.slug}</h1>; // runtime error in Next 15
}
TSX
npm run dev| API | Next.js 14 | Next.js 15 | Where it is used |
|---|---|---|---|
params | plain object | Promise<object> | page, layout, route handler, generateMetadata |
searchParams | plain object | Promise<object> | page only |
cookies() | sync getter | returns a Promise | server code, actions, route handlers |
headers() | sync getter | returns a Promise | server code, actions, route handlers |
draftMode() | sync | returns a Promise | preview routes |
generateStaticParams | array | array, unchanged | prebuild only |
The props type is generated from the route. Instead of hand-writing it, import the helper the framework ships with typed routes:
export default async function Page(props: PageProps<"/blog/[slug]">) {
const { slug } = await props.params;
return <h1>{slug}</h1>;
}For client components the value cannot be awaited, because they do not run on the server. Next.js 15 supports unwrapping a Promise with React.use, and useParams remains the simplest read:
"use client";
import { use } from "react";
export function SlugLabel({ params }: { params: Promise<{ slug: string }> }) {
const { slug } = use(params); // unwraps on the client
return <span>{slug}</span>;
}Key Comparison Table
| Location | Signature | Correct read | Failure if wrong |
|---|---|---|---|
| Page (server) | { params: Promise<{ slug: string }> } | const { slug } = await params | runtime sync-API error |
| Layout | same as page | await params | layout renders undefined route |
generateMetadata | (props: { params: Promise<...> }) | const { slug } = await props.params | wrong title, cached at build |
| Route handler | (req, ctx: { params: Promise<...> }) | const { id } = await ctx.params | 500 on every call |
| Client component | prop typed as Promise | use(params) or useParams() | hook rules violated if awaited |
generateStaticParams | no params argument | return array of segments | not a place for await params |
What changed for the same code in one place:
| Code | Next.js 14 | Next.js 15 | Note |
|---|---|---|---|
params.slug | works | undefined plus error | readable, never typed as a Promise |
await params | works, harmless | works | await on a plain object is legal |
cookies().get("id") | works | error | must be (await cookies()).get("id") |
headers().get("host") | works | error | same pattern |
searchParams.page | string | undefined | await first, then read |
dynamic = "force-static" | params available | params are empty | intentional under PPR |
Practical Edge Cases, Error Fixes & Deep Dive Code Examples
1. generateMetadata runs before the page
Metadata is generated by a separate call, so awaiting params in the page does not help here:
export async function generateMetadata({
params,
}: {
params: Promise<{ slug: string }>;
}): Promise<Metadata> {
const { slug } = await params;
const post = await getPost(slug);
return { title: post.title, description: post.excerpt };
}A missed await here is quiet: the page renders, but the document title becomes undefined and the value is cached with the route. Check the built HTML, not just the browser tab after client navigation.
2. Route handlers and the second argument
// app/api/orders/[id]/route.ts
export async function GET(
_req: Request,
ctx: { params: Promise<{ id: string }> },
) {
const { id } = await ctx.params;
return Response.json({ id });
}In Next.js 14 the same handler typed { params: { id: string } }. A handler that still does ctx.params.id answers 500 only on requests that reach a dynamic segment, so a health check on a static route stays green and the breakage hides until traffic arrives. Reproduce the actual request with the cURL command builder, then inspect the returned JSON with the JSON formatter.
3. Await once, then pass values down
Awaiting the same Promise repeatedly is safe, but reading it inside JSX leads to await in places that must stay synchronous:
export default async function Page({ params }: { params: Promise<{ slug: string }> }) {
const { slug } = await params; // one read at the top
const post = await getPost(slug);
return (
<div>
<PostHeader post={post} />
<Comments slug={slug} />
</div>
);
}Passing slug rather than the Promise keeps child components ordinary and testable. Components that need several values should accept resolved props, not the route object.
4. useSearchParams inside a client component
searchParams is server-only; client components read the query through the hook, which requires a Suspense boundary during prerender:
"use client";
import { useSearchParams } from "next/navigation";
function Filters() {
const sp = useSearchParams();
return <p>page {sp.get("page") ?? "1"}</p>;
}
export default function Page() {
return (
<Suspense fallback={<p>Loading…</p>}>
<Filters />
</Suspense>
);
}This is where the two errors meet: a missing Suspense reports a CSR bailout, and a missing await reports the sync-API error. When a query string misbehaves, decode it with the URL encoder to see whether the value is double-encoded before blaming the framework.
5. Layouts, nested segments and parallel routes
A layout receives only the segments above it. params in app/blog/[slug]/layout.tsx is a Promise holding { slug }, not the whole path. For catch-all routes, type the segments as arrays:
export default async function DocsLayout({
params,
}: {
params: Promise<{ path: string[] }>;
}) {
const { path } = await params;
return <nav aria-label={path?.join("/")}>{/* … */}</nav>;
}Optional catch-all segments return string[] | undefined, so guard before .join. In parallel routes, each slot resolves its own params; awaiting the parent's params in a slot that does not receive them gives a type error at build.
6. Static rendering, force-static and tests
With export const dynamic = "force-static", dynamic APIs return empty values by design: params resolves to {} and searchParams to an empty object. A page that needs the slug for content must not force static mode. In Playwright and other E2E tests, the same rule applies to mocks: a test helper that builds { params: { slug } } must now build { params: Promise.resolve({ slug }) }, or every test fails with the same sync-API message regardless of the code under test.
Common Compilation/Runtime Mistakes & Version Gotchas
Adding async without changing the type. async function Page({ params }: { params: { slug: string } }) compiles the body but fails the generated PageProps check. The type is what breaks the build, so change both together.
Awaiting in a client component. await is a syntax error outside an async function, and client components cannot be async. Use use(params) from React 19 or useParams().
Reading searchParams on a static route. Touching searchParams opts the page into dynamic rendering; with force-static the value is empty. If a page must stay static, read query state on the client with useSearchParams.
Forgetting cookies() and headers() in the same commit. They moved at the same time as params. A codebase that fixed pages but not actions fails later in a server action, where the stack trace points at the action rather than the upgrade.
Assuming await params costs a request. The Promise is already resolved; awaiting it adds a microtask, not I/O. Memoize data fetches instead of the params object.
Version notes. Next.js 15 makes the request APIs async and ships next-async-request-api in @next/codemod. Next.js 15.1 restored some legacy sync access behind experimental.staleTimes unrelated flags, so a project on a canary build may warn instead of throw. Next.js 16 removes the compatibility layer entirely. PageProps and RouteContext global helpers exist from 15.5 with typed routes enabled.
Reference material: page.js file convention and the Next.js 15 upgrade guide.
Official references
primary documentationThe Next.js documentation that defines the behaviour this guide explains.
Try matching browser tools
All toolsSmall utilities that fit Next.js work — they run entirely in this browser tab, so nothing you paste leaves your device.
Related Next.js guides
All Next.js guidesModule not found: Can't resolve a package or alias in Next.js
TypeScript and the bundler resolve imports separately. Align path aliases, workspace dependencies, exports conditions and filename case.
Next.js 16 DynamicServerError: cookies(), headers() and fetchCache
Request-time APIs make a route dynamic, and Next 16 replaced the segment configs with Suspense boundaries and use cache. What to delete and what to wrap.
Next.js cacheComponents: 'used uncached or runtime data' build error
Cache Components makes the build refuse to guess where the static shell ends. Stream it, cache it with use cache, or declare the route blocking.
next/font: Failed to fetch a Google font during the build
The font is fetched during the build, not at runtime. Vendor it with next/font/local or give CI and Docker a route out.
More in Next.js
All Next.js guidesThe guides filed next to this one in Next.js, in library order.