-
Notifications
You must be signed in to change notification settings - Fork 34
Open
Description
Bug Description
Getting a console error about an async Client Component:
<StarsCount> is an async Client Component. Only Server Components can be async at the moment.
This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server.
Error Location
src/components/site-header.tsx (31:11) @ SiteHeader
29 | className="ml-2 hidden h-4 lg:block"
30 | />
> 31 | <GitHubLink />
| ^
32 | <Separator orientation="vertical" className="h-4" />
33 | <ModeSwitcher />
34 | </div>
Call Stack
- SiteHeader: src/components/site-header.tsx (31:11)
- DocsLayout: src/app/(docs)/docs/layout.tsx (13:7)
Expected Behavior
The StarsCount component should work without throwing async Client Component errors.
Possible Solution
The StarsCount component inside GitHubLink might be marked as a Client Component but is using async/await. This needs to be refactored to either:
- Make it a Server Component by removing 'use client'
- Move the async logic to a Server Component wrapper
- Use client-side data fetching (useEffect/SWR/React Query) instead of async/await
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels