Route used `searchParams.q`. `searchParams` should be awaited before using its properties
Filed under Next.js & React errors
Next.js 15 turned the searchParams prop into a promise, so reading values like searchParams.page directly triggers the error — the page has to await it first.
Fastest route
Give your AI this prompt
Copy it, replace the bracketed part with your error, and send it.
Preview the prompt
My Next.js 15 app logs this error: "Route '/[paste your route]' used `searchParams.[property]`. `searchParams` should be awaited before using its properties." (It may also mention sync-dynamic-apis.)
Here is the page that reads searchParams: [paste the page file].
Please: 1) make the page component async, 2) await searchParams once at the top before any property is read, spread, or enumerated, 3) update the TypeScript prop type to Promise<{ ... }> using my real query keys, with values typed as strings, 4) search the rest of the project for other direct searchParams reads in the old synchronous style and list them for me.
Constraints: do not switch the page to the useSearchParams() hook, do not change what the page renders or how it fetches data, and do not change the route structure — only how searchParams is unwrapped. Show me each file you change.Fix it yourself
Follow the repair
- Make the page async and await searchParams before reading it. This single edit clears the error in most cases:
Await once, at the top, before any value is read — reading even one property first and awaiting afterwards still trips the error.// Before (Next.js 14 style — triggers the error in 15) export default function Page({ searchParams }) { const page = searchParams.page ?? "1"; // ... } // After — same page, awaited export default async function Page({ searchParams }) { const { page = "1" } = await searchParams; // page is a normal string from here on } - Update the TypeScript type to a Promise. If the build now complains about the prop type instead, the type is still the old shape. Change it to match, using your real query keys:
Values in searchParams are strings (or arrays of strings for repeated keys), never numbers — convert page with Number(page) when you do math with it.export default async function Page({ searchParams, }: { searchParams: Promise<{ page?: string; sort?: string }>; }) { const { page, sort } = await searchParams; // ... } - Do not spread or enumerate before the await. { ...searchParams }, Object.keys(searchParams), and looping over it all read the promise's properties early and trigger the same error, sometimes with an extra message about properties "not available through enumeration." Await first, then spread or loop over the plain object you get back.
- Do not confuse this with the useSearchParams() hook. They sound identical and are different APIs. The searchParams prop belongs to server-rendered pages and is what this error is about. useSearchParams() is a hook for Client Components; it does not produce this error (it has its own, separate Suspense-boundary requirement at build time). If the file starts with "use client" and uses the hook, this page's fix does not apply — and passing the searchParams prop down into a Client Component is not the pattern either; read it in the server page and pass the plain values down as ordinary props.
- Check your other pages — filters, tabs, and pagination hide this. Any page that reads the URL query is a candidate: search results, product filters, sort controls, paginated lists. Search your project for
searchParams.and confirm every hit sits below an await. A page that only reads searchParams inside a conditional branch can pass your testing and still log the error the first time a visitor lands on that branch. - On a big upgraded project, run the official codemod. Next.js ships an automated migration for this whole family of changes:
npx @next/codemod@canary next-async-request-api. It rewrites the common params, searchParams, cookies, and headers patterns across the project. Run it, then do the search from step 5 anyway — the codemod leaves a@next-codemod-errorcomment anywhere it could not safely rewrite, and those spots need the manual await.
Why this happensOptional explanation
In Next.js 14 and earlier, a page received searchParams as a plain object: you wrote searchParams.page and got the value. In Next.js 15 it arrives as a promise of that object. Next.js made the change so a page can start rendering before every detail of the incoming request is resolved, which speeds up streaming. Reading a value synchronously, the old way, now triggers the error you are seeing — and so does spreading or looping over it, because that also reads it before the promise resolves.
Search pages and listing pages are where this one hides. A blog's dynamic routes get fixed during the Next.js 15 upgrade because the params error is loud and everywhere, while the one quiet page that reads a ?sort= or ?page= value keeps logging its own version of the complaint. In current versions the old access still works after logging the error — it is a grace period, not a pardon — and the synchronous access is being removed, so leaving it means a future upgrade breaks the page for real.
- Upgraded from Next.js 14: the page predates the change and reads searchParams directly.
- AI-generated code in the old style: AI builders write the Next.js 14 pattern from memory, even in brand-new Next.js 15 projects.
- params fixed, searchParams missed: the two changed together, and most people only fix the one named in the first error they read.
- Even one small read counts: a single searchParams.q in a login or search page is enough — and so is spreading it with { ...searchParams }.
Quick answers
Should I switch to useSearchParams() instead?
No. The searchParams prop is read in the server-rendered page: await it there and pass the plain values (page, sort, q) down to Client Components as ordinary props. useSearchParams() is a separate hook for Client Components, with its own Suspense requirement — switching to it is a different pattern, not this fix.
My page only reads one value. Can that really trigger it?
Yes — any read counts, including one conditional read, spreading it with { ...searchParams }, or looping over its keys. All of those touch the promise's properties before it resolves, which is exactly what the error is policing. Await it once at the top of the page and use the plain object everywhere below.
Is this just a warning? The page still works.
In current Next.js 15 versions, yes: the old synchronous access still returns the value after logging the error, as a migration grace period. It is scheduled for removal, and the console noise buries real errors — treat the message as a to-do with a deadline, not background static.