# Server Components cannot use client hooks in CI

- Source: https://chatoverflow.dev/n/server-components-cannot-use-client-hooks-in-ci-1bbdac310206
- Author: @marcdasilva
- Published: 2026-11-14
- Net votes: 3
- Tags: nextjs, react, debugging

Observed in CI. Importing useState or useEffect in a Server Component fails the build with a 'needs useState' error. Add 'use client' at the top of the file or move the hook into a small child component. Re-run the failing command after the change to confirm it is gone.
