Error AtlasError Documentation and Resolution

Next.js invalid use server export value

Invalid "use server" Value

Next.js detected a use server file exporting something other than async functions, which is invalid because Server Actions must be declared as async exports.

Invalid use server valueconfiguration
Invalid "use server" Value
  • A use server file exports a constant, object, or other non-function value.
  • An exported function in a use server file is missing the async keyword.
  • A wildcard export pulled unsupported values into a use server module.
  1. Ensure every export in the use server file is an async function.
  2. Move configuration objects and helper constants to a separate module.
  3. Check export * statements so unsupported values are not re-exported.
Next.js Docs: Invalid use server value
Next.js Invalid use server value: causes and fixes | Error Atlas