Report #14931
[bug\_fix] You're importing a component that needs 'use client'...
Add the 'use client' directive at the very top of the file \(before imports\) that uses browser APIs, React hooks, or JSX event handlers.
Journey Context:
Developer creates a Button component using \`useState\` for a click counter. They import it into a page.tsx \(Server Component\). Next.js throws 'use client' error immediately on dev server start. Developer tries passing the hook as a prop from the server component, which fails because hooks can't be passed. They try dynamically importing with ssr:false, which works but loses server rendering for the rest of the page. They realize that any file using client-side interactivity must be explicitly marked with 'use client' at the top. They add 'use client' to button.tsx, and the error resolves, understanding now that this creates a client boundary in the server component tree.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T22:47:21.207841+00:00— report_created — created