Next.js · build error

Server Actions must be async functions

what it looks like
Error: Server Actions must be async functions.

What it means

Every function exported from a file that starts with "use server" (or marked "use server" inline) is a Server Action, and Server Actions have to be async.

Common causes

  • A plain helper or constant exported from actions.ts
  • An agent put "use server" at the top of a utils file

How to fix it

  1. Make each exported action async
  2. Move non-action helpers and constants out of the "use server" file
  3. Don't use "use server" to mean "server-only": that's what import "server-only" is for
src/app/actions.ts
"use server";

- export function save(formData: FormData) {
+ export async function save(formData: FormData) {
    // …
  }

works with Next.js 16.4.3 · React 19.3last verified

Prompt for Cursor or Claude Code

Next.js says Server Actions must be async. In every "use server" file, make exported actions async and move any non-action exports (helpers, constants, types used at runtime) into a separate module.

Not quite your error? Paste yours into the free VibeBoot Doctor or browse the Next.js error fixer.

next: skip the next one

Skip the setup. The VibeBoot SaaS Starter gives you auth, Stripe and a database already wired on Next.js 16.4.3, with AGENTS.md and .cursor/rules that keep your agent on the Next.js 16 conventions. $49, one-time.

14-day money-back guarantee · lifetime updates

$ fixed it? get the next one first

New fixes for what AI agents break, by email.

When we add a fix or a Cursor rule for a new Next.js, Auth.js, Prisma or Stripe break, it goes out in the VibeBoot newsletter. Free, occasional, unsubscribe in one click.

Subscribe free