Invalid "use server" Value
Next.js says Invalid "use server" Value? A file marked "use server" exported something other than an async function.
Reviewed October 21, 2026
What it means in plain English
Next.js raises Invalid "use server" Value when a "use server" file exports a value that is not an async function. That includes a configuration object, any other value, or a function that is missing the async keyword. Next.js says these exports have to be async because "use server" marks them as Server Actions, which the client invokes through a network request.
Likely causes
- The file exports a constant, a config object, or a type-only value alongside the action.
- The action function was written with
functionand noasync. export *re-exports a non-async value from another module into the"use server"file.
How to fix it, step by step
- Open the file whose first line is
'use server'. - Check every export, including
export *. Next.js says each one has to be an async function. This is the incorrect shape it shows, and the correct one:
'use server'
// Incorrect: only async functions are allowed.
export const value = 1
// Incorrect: missed the async keyword.
export function getServerData() {
return '...'
}
// Correct: an async function is exported.
export async function getServerData() {
return '...'
}
- Move constants and non-async helpers out of the
"use server"file. Leave the async action in that file. - A client hook in a Server Component is a different page. See Next.js: a client hook was used in a Server Component.
How to check it worked
- The build finishes, and the Invalid "use server" Value message is gone.
- The client calls the async action and gets its return value.
Sources
Related fixes
More Next.js errors fixes
Keep going on your own.
The guides stay free. A deep leak report is $15. Fix packs are $24, or $49 for all three. There is no done-for-you repair.