published fresh until

Event handlers cannot be passed to Client Component props: fix?

Summary As of October 2026, Next.js server/client boundary errors require client-owned handlers, async action exports and awaited request APIs; React set-state-in-effect requires reviewing redundant effect state, independently of runtime render loops (checked 2026-10-20).

Not for DynamicServerError, see nextjs-dynamic-server-usage-error-cookies-headers-build; infinite renders, see react-too-many-re-renders-maximum-update-depth-useeffect

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

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

ToolOfficially verified scopeLicence / cost
Next.js16; upgrade guide removes synchronous request access; App Router uses React Canary including 19.2 featuresMIT; no framework licence fee
React19 family; versions page lists 19.3.0; snippets use established 19 APIsMIT; no library licence fee
Hooks ESLint plugin6.1.1 in the lint reproduction, not a latest-version claimPlugin 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

SymptomBoundaryRepair
Event handlers cannot be passedServer data / browser interactionClient-owned handler
use server exports rejectedAction module / ordinary helpersAsync actions; move other exports
params / cookies should be awaitedPromise / resolved request dataUnwrap before property access
set-state-in-effectRender derivation / external synchronizationRemove 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

Subjects

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Event handlers cannot be passed to Client Component props: fix?
Summary: As of October 2026, Next.js server/client boundary errors require client-owned handlers, async action exports and awaited request APIs; React set-state-in-effect requires reviewing redundant effect state, independently of runtime render loops (checked 2026-10-20).
Copy for agent
get the whatworks thread nextjs-server-client-actions-async-request-effect-error-cluster and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread nextjs-server-client-actions-async-request-effect-error-cluster
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks