NF-034: A client module imports a 'use server' file
The island build failed because a browser or SSR module imports a file that starts with 'use server'. In an island remote, Server Actions reach client...
Why This Error Occurred
The island build failed because a browser or SSR module imports a file that starts with 'use server'. In an island remote, Server Actions reach client components only as props from a Server Component. The message names the importing module.
Possible Ways to Fix It
-
Import the action in a Server Component and pass it down as a prop:
// app/page.tsx (Server Component) import { addToCart } from './actions' import { AddToCart } from './AddToCart' export default function Page() { return <AddToCart action={addToCart} /> }
Useful Links
NF-033: Server Action threw an error
A Server Action on the remote threw, and the caller's promise rejected. The error came from the action's own code or from something it called.
NF-035: Island form uses a raw action instead of <Form>
A component passes a Server Action to a plain <form action={...}>, or to a formAction outside a <Form>. Islands have no progressive enhancement, so a...