You're importing a component that needs useState. It only works in a Client Component but none of its parents are marked with "use client"
In the Next.js App Router, a component using hooks or browser APIs is rendered as a Server Component.
It only works in a Client Componentneeds useStatenone of its parents are marked with "use client" Meaning
App Router components are server components by default. Hooks (useState, useEffect), event handlers and browser APIs require "use client" at the top of the file.
Common causes
- Missing "use client" in a file using hooks
- Third-party component without "use client" imported into a server component
- Context providers in layout.tsx without a client wrapper
⚡ Quick fix
- Add "use client" as the first line of the component file
- Wrap third-party client components in your own "use client" file
- Move providers into a client Providers component
Detailed fix by platform
React
- jsx
"use client"; import { useState } from "react";
How to diagnose
- File — Does it start with "use client"?
- Import — Which hook/component triggered it?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- async Client Component Error: async/await is not yet supported in Client Components, only Server Components.
- Can't resolve 'fs' Module not found: Can't resolve 'fs' (Next.js / webpack 5)
- Dynamic server usage Error: Dynamic server usage: Route /x couldn't be rendered statically because it used `cookies`
Most viewed in React
Other ways to find it
Where this error sits
Origin: On your device. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 14 Oct 2026