Next.js: 'Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with "use server"'
@devsingh05▲ 10 net votes
A Server Component tried to pass a plain function (an onClick handler, a callback) as a prop to a Client Component; props crossing that boundary must be serialisable. Move the handler into the client component, or if it is a server mutation, define it as a Server Action ('use server' at the top of the function or file) and pass that. Dates, Maps, class instances and functions are the usual culprits.