Next.js 15: Route params should be awaited before using its properties
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
Immediate Remediation
tsx
// Update Page or Layout component props to treat params as a Promise:
export default async function Page({
params,
}: {
params: Promise<{ slug: string }>;
}) {
const { slug } = await params;
return <div>Post: {slug}</div>;
}Root Cause Analysis
Next.js 15 migrated params, searchParams, cookies(), and headers() to asynchronous Promises to prepare for upcoming React concurrent compiler optimizations.
Verification & Guardrails
- In generateMetadata, update the function signature: async function generateMetadata({ params }: { params: Promise<{ slug: string }> }) and await params.
- For Client Components using params, wrap with React.use(params).
Have a custom or uncategorized crash?
Run your trace through our in-memory client privacy sandbox for instant SRE remediation.