# Next.js: Error: Server actions must be async functions

**Code:** `Server actions must be async functions` · **Category:** Next.js · **Seen on:** Next.js, React

A function marked `"use server"` isn't declared `async`.

## Meaning

Server Actions are invoked over the network and must return a Promise. Add `async` to every exported function in a `"use server"` file. In files with `"use server"` only async function exports are allowed (constants/types can't be exported).

## Common causes

- Missing `async` keyword
- Exporting a non-function value from a "use server" file
- Arrow function exported without async
- Inline action without async
- Re-exporting synchronous helpers

## Quick fix

1. `export async function save(formData: FormData) {}`
2. Keep non-async helpers in a separate file without "use server"
3. Move constants to another module

## Detailed fix by platform

### Next.js

1. 

```tsx
"use server";
export async function createPost(formData: FormData) { /* ... */ }
```


## How to diagnose

1. **Keyword** — async?
2. **Exports** — Only async functions?
3. **Helpers** — Separate file?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/nextjs/server-actions-must-be-async)
