← All errors · Next.jsNext.js App Router & config errors

async/await is not yet supported in Client Components

Exact error

Error: async/await is not yet supported in Client Components, only Server Components.

What it means

A component marked "use client" was declared as an async function. Only Server Components can be async.

Likely causes

How to fix it

  1. Option A: remove "use client" and keep the async data fetching in a Server Component, passing data down to a small client child.

  2. Option B: keep it a client component and fetch in an effect:

    'use client';
    import { useEffect, useState } from 'react';
    export default function Posts() {
      const [posts, setPosts] = useState([]);
      useEffect(() => { fetch('/api/posts').then(r => r.json()).then(setPosts); }, []);
      return <ul>{posts.map(p => <li key={p.id}>{p.title}</li>)}</ul>;
    }

Prevent this next time

FAQ

What does "async/await is not yet supported in Client Components" mean?

A component marked "use client" was declared as an async function. Only Server Components can be async.

What usually causes it?

Adding "use client" to a page that does `export default async function`. Fetching data with await directly inside a client component body.

How do I fix it?

1. Option A: remove "use client" and keep the async data fetching in a Server Component, passing data down to a small client child. 2. Option B: keep it a client component and fetch in an effect:

Related errors

Get new fixes weekly

No spam. Unsubscribe anytime. Privacy