async/await is not yet supported in Client Components, only Server Components
Stop awaiting directly in the client component; fetch in a server component and pass the data down as props. The error disappears once the client file has no top-level await. Applies to: Next.js 13+ app router.
TL;DR
Stop awaiting directly in the client component; fetch in a server component and pass the data down as props. The error disappears once the client file has no top-level await.
The exact error
async/await is not yet supported in Client Components, only Server ComponentsSteps to fix
- Find the async function or await the error points at in your "use client" file
- Move the data fetch into the parent server component or a server action
- Pass the resolved data to the client component as a prop
- Rebuild; the error should clear
When this applies
- Next.js 13+ app router
- A client component tries to await data directly
When this does NOT apply
- Server components, where async/await is fine
- Fetching inside useEffect, which never needed this
Tool + versions
Next.js 13+ app router
Why it happens
Client components are bundled for the browser and cannot suspend on a promise during render the way server components can, so Next.js blocks the pattern at build time.
Edge cases
- Server actions are the other legal way to run async work from a client component
- Passing a promise as a prop and awaiting it in the client still fails
Where this came from
Resolved from a real public thread: https://nextjs.org/docs/app/building-your-application/rendering/client-components (docs:client-components-async).