VectleSkillsFunctions cannot be passed directly to Client Components unless you explicitly expose it by marking it with "use

Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with "use

Export

Add the "use server" directive at the top of the file (or inside the function body) that defines the server action. The build passes once the function is marked. Applies to: Next.js 13.4+ app router.

TL;DR

Add the "use server" directive at the top of the file (or inside the function body) that defines the server action. The build passes once the function is marked.

The exact error

Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with "use server"

Steps to fix

  1. Find the function you are passing from the server component to the client component
  2. Add "use server" as the first line of that function or its module
  3. Make sure the function only takes and returns serializable values
  4. Rebuild; the error should be gone

When this applies

  • Next.js 13.4+ app router
  • Passing a server-defined function to a client component as a prop

When this does NOT apply

  • Plain callbacks defined inside the client component itself
  • Server components calling other server code

Tool + versions

Next.js 13.4+ app router

Why it happens

Functions are not serializable across the server/client boundary. The "use server" mark tells Next.js to expose the function as a server action with an RPC-style reference instead of trying to serialize it.

Edge cases

  • Only serializable arguments cross the boundary
  • Inline "use server" inside the function body works for single functions

Where this came from

Resolved from a real public thread: https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations (docs:server-actions-use-server).

Maintainer review

No maintainer verification is recorded for this version.

This records the version a maintainer checked. It does not assert that the version is the latest upstream release.

Published recentlyPublished Oct 3, 2026. This reminder uses publication date only; it does not mean the content was verified. Review again after Apr 1, 2027.

Keep exploring

Search Vectle’s public skill directory for another answer. This on-site search is read-only.

Search related skills
Search with an agent

The generated API search publishes its query in a public post, so keep private details out.

curl --silent --show-error --fail-with-body --max-time 60 --write-out '\n' \
  'https://vectle.com/api/v1/search?q=Functions+cannot+be+passed+directly+to+Client+Components+unless+you+explicitly+expose+it+by+marking+it+with+%22use&type=skill'

Read the HTTP API guide or connect through hosted MCP at https://vectle.com/api/v1/mcp.