v0 api

Next.js Server Action Not Callable from Client Component

Your Next.js server action defined with 'use server' directive isn't callable from client components, or throws 'function not defined' errors. Forms and onClick handlers can't invoke server actions.

Server actions fail when not properly imported, 'use server' is misplaced, or there's a server-client boundary violation in how the action is used.

Error Messages You Might See

ReferenceError: submitForm is not defined Server action not bound [server-action] Not a valid server action Function is not serializable
ReferenceError: submitForm is not definedServer action not bound[server-action] Not a valid server actionFunction is not serializable

Common Causes

  1. 'use server' directive in client component instead of server file or top of function
  2. Server action file not properly exported or imported in client component
  3. Passing non-serializable objects to server action (functions, class instances)
  4. Server action defined in client component file with 'use client'
  5. Async/await not properly handled when calling server action

How to Fix It

Create server action file: Make separate file with 'use server' at top, export the async function:
'use server'
export async function submitForm(formData) { ... }

Import in client: In client component, import and call normally:
import { submitForm } from '@/actions'
onClick={() => submitForm(data)}

Handle async: Wrap in useTransition hook for loading state:
const [pending, startTransition] = useTransition()
startTransition(() => submitForm(data))

Pass FormData: For forms, pass FormData object directly, not individual fields.

Real developers can help you.

Jen Jacobsen Jen Jacobsen I’m a Full-Stack Developer with over 10 years of experience building modern web and mobile applications. I enjoy working across the full product lifecycle — turning ideas into real, well-built products that are intuitive for users and scalable for businesses. I particularly enjoy building mobile apps, modern web platforms, and solving complex technical problems in a way that keeps systems clean, reliable, and easy to maintain. Luca Liberati Luca Liberati I work on monoliths and microservices, backends and frontends, manage K8s clusters and love to design apps architecture Caio Rodrigues Caio Rodrigues I'm a full-stack developer focused on building practical and scalable web applications. My main experience is with **React, TypeScript, and modern frontend architectures**, where I prioritize clean code, component reusability, and maintainable project structures. I have strong experience working with **dynamic forms, state management (Redux / React Hook Form), and complex data-driven interfaces**. I enjoy solving real-world problems by turning ideas into reliable software that companies can actually use in their daily operations. Beyond coding, I care about **software quality and architecture**, following best practices for componentization, code organization, and performance optimization. I'm also comfortable working across the stack when needed, integrating APIs, handling business logic, and helping transform prototypes into production-ready systems. My goal is always to deliver solutions that are **simple, efficient, and genuinely useful for the people using them.** Vlad Temian Vlad Temian 15+ years shipping production infrastructure for startups. Former CTO at qed.builders (acquired by The Sandbox). Cursor ambassador and agentic tooling builder. I've scaled systems, automated deployments, and built observability tools for AI coding workflows. I specialize in taking vibe-coded apps from broken prototype to production-ready: fixing Supabase auth/RLS, Stripe integrations, deployment pipelines, and cleaning up AI-generated spaghetti. I build tools in this space (agentprobe, claudebin, micode) and understand both sides: how AI generates code and why it breaks. https://blog.vtemian.com/ Prakash Prajapati Prakash Prajapati I’m a Senior Python Developer specializing in building secure, scalable, and highly available systems. I work primarily with Python, Django, FastAPI, Docker, PostgreSQL, and modern AI tooling such as PydanticAI, focusing on clean architecture, strong design principles, and reliable DevOps practices. I enjoy solving complex engineering problems and designing systems that are maintainable, resilient, and built to scale. Antriksh Narang Antriksh Narang 5 years+ Experienced Dev (Specially in Web Development), can help in python, javascript, react, next.js and full stack web dev technologies. Matthew Butler Matthew Butler Systems Development Engineer @ Amazon Web Services AUXLE AUXLE I am a Full Stack Developer experienced in building Websites, Web apps and Cross Platform Mobile Apps for Startups and Companies. Richard McSorley Richard McSorley Full-Stack Software Engineer with 8+ years building high-performance applications for enterprise clients. Shipped production systems at Walmart (4,000+ stores), Cigna (20M+ users), and Arkansas Blue Cross. 5 patents in retail/supply chain tech. Currently focused on AI integrations, automation tools, and TypeScript-first architectures. Rudra Bhikadiya Rudra Bhikadiya I build and fix web apps across Next.js, Node.js, and DBs. Comfortable jumping into messy code, broken APIs, and mysterious bugs. If your project works in theory but not in reality, I help close that gap.

You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.

Get Help

Frequently Asked Questions

Where do I define server actions?

In a separate file with 'use server' at the top, or at function level inside a server component.

Can server actions access databases?

Yes, that's their main purpose. Server actions run only on server, so database queries are safe and secret keys protected.

How do I show loading state during server action?

Use useTransition hook: const [pending] = useTransition(); pending shows true while action runs.

Related v0 Issues

Can't fix it yourself?
Real developers can help.

You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.

Get Help