Fix guides · Cursor, v0, Claude Code, Lovable ·
Fix Next.js 15+ async Request-time APIs
Next.js 15+ App Router page props are Promises
In Next.js 15 and 16, App Router pages receive params and searchParams as Promises that must be awaited. In Next.js 15 synchronous access still works but logs a deprecation warning; Next.js 16 removes that fallback, so it breaks. The fix is to await props.params and props.searchParams in page.tsx, or use the use() hook in client components. Pages Router (getServerSideProps/getStaticProps) is not affected by this change.
Common causes – and how to tell which one you have
1. App Router page reads props.params without awaiting
How to tell: The file is app/**/page.tsx or layout.tsx. In Next.js 15, reading params synchronously logs a deprecation warning and still works. In Next.js 16, synchronous access returns undefined and the page breaks. You see undefined values or TypeScript Promise-type errors at build time.
Fix: In page.tsx: const { slug } = await props.params; const query = await props.searchParams; In layout.tsx: await props.params only.
2. Client component reads params without useParams or use()
How to tell: A Client Component ("use client") under app/ needs route params. props.params is still a Promise there.
Fix: Use useParams() from next/navigation for synchronous params, or unwrap the Promise with React's use() hook: const params = use(props.params).
How to fix it
- Open the full error in your terminal or Vercel build logs and find the first stack trace line pointing to your own code.
- Check whether this is an App Router page (app/**/page.tsx), an App Router layout (app/**/layout.tsx), or a Pages Router page (pages/**). The async params change only applies to the App Router. In the Pages Router, route values come from getServerSideProps/getStaticProps context (context.params, context.query) or router.query.
- If App Router page: make the function async and await both: const { slug } = await props.params; const query = await props.searchParams;
- If App Router layout: await props.params only (layouts have no searchParams). In client components, use the useParams() hook from next/navigation, or unwrap the Promise with React's use() hook: const params = use(props.params).
- In a client component, you can unwrap a Promise with the use() hook: const params = use(props.params).
- Run next build and fully reload the affected page to confirm the error and any hydration warnings are gone.
Using Lovable, Bolt or v0?
In Cursor or Claude Code, paste the full error from the build log and the relevant page file. Ask the tool to identify whether this is an App Router or Pages Router page, and suggest making the page async with await, or using useParams() for client components. Ask it to run next build afterwards and confirm no errors remain. Do not turn off TypeScript checks or add @ts-ignore.
Using Cursor, Claude Code or Windsurf?
Give the agent the complete stack trace and the page file content. Have it determine if the page is App Router or Pages Router, and whether the fix is making the page async with await, or using useParams() for client components. Have it run next build and reload the page with a full refresh to confirm. Never use --ignoreBuildErrors or add @ts-ignore to suppress this error.
The “fix” to avoid
Agents often set typescript: { ignoreBuildErrors: true } in next.config, turn off strict mode, or add @ts-ignore/as any until the build passes. The error is a real type/Promise issue that ships unchecked to production. Fix the types so the compiler protects you.
Copy-paste fix prompt for your AI coding tool
Paste this into Cursor, Claude Code, Lovable or Bolt:
My Next.js app throws an error about props.params or props.searchParams being undefined. First check: is this an App Router page (under app/) or a Pages Router page (under pages/)? If Pages Router, the async params change does not apply — check getServerSideProps or getStaticProps instead. If App Router: make the page function async and await props.params and props.searchParams. For client components, use useParams() from next/navigation for synchronous params, or use the use() hook to unwrap a Promise. Then run next build and reload the page with a full refresh to confirm the error is gone.
Questions people ask
Why does this work on Next.js 15 but break on 16?
Next.js 15 kept a synchronous fallback that still resolved params but logged a deprecation warning. Next.js 16 removed that fallback, so synchronous access now returns undefined. Awaiting params works on both versions.
Is useSearchParams() a Promise?
No. useSearchParams() from next/navigation is a synchronous client-side hook returning ReadonlyURLSearchParams — do not await it, and it is not available in Server Components. In a Server Component, read the searchParams prop on page.tsx, which is a Promise you must await.
What is the use() hook?
The use() hook in React 19+ can synchronously unwrap a Promise inside a component. In Next.js 15+, you can use it to read props.params in a client component: const params = use(props.params).