What this thread does
The problem
An agent moves code between server, client and action files, then app or lint fails. Match the boundary before changing directives.
Versions, licences and price scope — checked 2026-10-20
| Tool | Officially verified scope | Licence / cost |
|---|---|---|
| Next.js | 16; upgrade guide removes synchronous request access; App Router uses React Canary including 19.2 features | MIT; no framework licence fee |
| React | 19 family; versions page lists 19.3.0; snippets use established 19 APIs | MIT; no library licence fee |
| Hooks ESLint plugin | 6.1.1 in the lint reproduction, not a latest-version claim | Plugin licence/price not compared |
Record npm ls next react react-dom eslint-plugin-react-hooks. Recipes are untested; no hosting price is quoted.
When to pick which
| Symptom | Boundary | Repair |
|---|---|---|
| Event handlers cannot be passed | Server data / browser interaction | Client-owned handler |
| use server exports rejected | Action module / ordinary helpers | Async actions; move other exports |
| params / cookies should be awaited | Promise / resolved request data | Unwrap before property access |
| set-state-in-effect | Render derivation / external synchronization | Remove redundant effect state |
Event handlers cannot be passed to Client Component props
Exact message: Error: Event handlers cannot be passed to Client Component props. Verified in Elindo586's discussion 67858, checked 2026-10-20.
Move the element and browser handler together into a client file. Marking only its receiver client cannot serialize a server-created callback. In app/components/submit-button.tsx:
'use client'
export default function SubmitButton() {
return <button onClick={() => console.log('clicked')}>Submit</button>
}
Render <SubmitButton /> with serializable data props. A server mutation can use a properly defined Server Action reference. Run npm exec -- next build, then exercise the button.
Do not mark the root layout client or import server-only code into the island. Next use client reference, checked 2026-10-20, defines the boundary.
A use server file can only export async functions
Exact message: Error: A "use server" file can only export async functions. Verified in RiodeJaneiroo's issue 62926, checked 2026-10-20.
The directive marks module exports as actions. Move constants and cached/synchronous helpers elsewhere; export async actions. Fill this skeleton with the existing authorized mutation:
'use server'
export async function saveItem() {
// Authenticate, authorize, validate, then perform the existing mutation.
}
Run npm exec -- next build and action tests. Do not add async to every utility or use use server as a generic server-only marker. Invalid use server value, checked 2026-10-20, gives the requirement. Current wrapper behavior is not established by that report.
params should be awaited
Exact source message:
Error: Route "/[locale]/app" used `params.locale`. `params` should be awaited before using its properties.
Verified in Cielquan's issue 74918, checked 2026-10-20. Ordinary application cause: treating promised params as a resolved object. For app/[locale]/page.tsx:
export default async function Page(
{ params }: { params: Promise<{ locale: string }> }
) {
const { locale } = await params
return <p>{locale}</p>
}
A synchronous Client Component can use React's use(params). For many unmigrated APIs, run the official codemod on a branch and inspect its diff/comments:
npx @next/codemod@canary next-async-request-api .
npm exec -- next build
Do not use await params.locale or casts to retain synchronous access. Async API error guide, checked 2026-10-20.
Exception: 74918 reports generated icon metadata under Turbopack without user params access, on Next 15.1.4 (not the scan's 15.1.0). Reduce generated-metadata cases and check release notes; do not invent await sites or delete icons. The claimed 15.2.3 fix is unverified.
cookies() should be awaited
Verified source substring: cookies() should be awaited before using its value. Eonis48's discussion 81445, checked 2026-10-20, contains the diagnostic and synchronous store code. Await the store before calling its methods, making helpers and their callers async:
import { cookies } from 'next/headers'
export async function readTheme() {
const cookieStore = await cookies()
return cookieStore.get('theme')?.value
}
Await the store inside Supabase's server-client factory and await that factory at call sites. Run npm exec -- next build and authenticated-route tests. Do not write await cookies().get(...): property access happens first. Do not copy the report's assertion that cookies is synchronous, or use force-dynamic as an async API fix. Next async request APIs, checked 2026-10-20. Supabase auth adapter changes are outside scope.
Calling setState synchronously within an effect
Exact message: Error: Calling setState synchronously within an effect can trigger cascading renders, verified in karlhorky's issue 34743, checked 2026-10-20. This is react-hooks/set-state-in-effect; it can fail CI without an infinite runtime loop or the compiler being enabled.
Replace redundant effect state with render derivation, e.g. const selected = items.find(item => item.id === selectedId). Initialize initial-only state directly. Preserve subscriptions; the official page allows ref-based measurement.
Run npm exec -- eslint . --max-warnings 0, then verify interaction and hydration. Do not disguise redundant setters with setTimeout/startTransition or disable the rule project-wide. Mount-only UI and external-system cases need individual review. React lint guidance, checked 2026-10-20.
What the community says
- Elindo586's 67858 has icyJoseph's accepted explanation of server defaults/client boundaries. Small discussion, not prevalence data.
- karlhorky's 34743 questions lint strictness and supplies a failing ESLint command. This supports distinguishing lint from loops, not exempting every effect.
Recommendation by constraint and agent prompt
Separate server fetching, browser interaction and action exports. Unwrap request data; review lint separately.
Read the linked official source for each exact diagnostic; do not guess. Record versions, trace boundaries and request Promises, and show one repair. Inspect generated metadata separately. Rerun the failing command, build and ESLint, then test interaction. Report untested auth/hydration.
Limits
No reproduction, build, lint, auth or browser test was run. Unverified requested error strings remaining: none. Historical messages are not guaranteed verbatim output from Next 16. The 15.2.3 metadata-fix claim remains unverified. Evidence is historical and thin; October demand and agent success were not measured. The Not for neighbours cover DynamicServerError and infinite loops.
Started from a post by @Elindo586, packaged by the editor. Original post