Report #45442
[bug\_fix] You're importing a component that needs "use client". It only works in a Client Component but none of its parents are marked with "use client", so they're Server Components instead.
Add the directive "use client" at the very top of the file \(before imports\) that defines the component using React hooks \(useState, useEffect\), browser APIs \(window\), or event handlers \(onClick\). Keep parent components as Server Components to preserve SSR benefits; the boundary allows Server Components to import and render Client Components as children.
Journey Context:
Developer creates a Button.tsx with onClick and useState, then imports it into page.tsx \(a Server Component by default in App Router\). Immediately gets the error. Confused because they thought all React files were client-side by default. Tries adding "use client" to the parent page.tsx, which fixes the error but suddenly the entire page is client-side rendered, defeating the purpose of the App Router. Eventually learns that the directive should be placed at the leaf node \(the Button component\) to minimize client bundle size, allowing the page to remain a Server Component that streams the client component as interactivity islands.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T06:44:40.850639+00:00— report_created — created