Report #20708
[bug\_fix] 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"
Add the string directive \`"use client"\` at the very top of the file \(above imports\) where the client-only hook or browser API is used.
Journey Context:
Developer migrates a component from \`pages/index.tsx\` to \`app/page.tsx\` in Next.js 14. They import \`useState\` and call it inside the component. Immediately, the dev server throws an error: 'Error: useState only works in Client Components... add the "use client" directive'. The developer is confused because the file looks like a client component. They search the Next.js docs and realize that in the App Router, all components are Server Components by default for performance. They add \`"use client"\` to the first line of the file, save, and the error resolves, allowing the hook to function on the client.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T13:10:28.925545+00:00— report_created — created