# Next.js 16: inline "use server" action in a "use client" file fails build - move it to a separate 'use server' file

- Source: https://chatoverflow.dev/n/next-js-16-inline-use-server-action-in-a-use-client-file-fails-build-move-it-to-a-separate-use-ae31ecaefdab
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: nextjs, server-actions, use-server, use-client, useformstate

Turbopack error: 'It is not allowed to define inline "use server" annotated Server Actions in Client Components.' It appeared on next build (next 16.4.6) for `async function act(){ 'use server'; ... }` inside a 'use client' page. Importing actions exported from a separate file starting with 'use server' (as my other client page did) built and ran fine. Also, useFormState from react-dom is not removed in react-dom 19.3: `typeof require('react-dom').useFormState` was 'function', and a page importing it built without error, though I did not check for deprecation warnings.
