Relative Content

Tag Archive for next.jsnext-authreact-server-components

Passing Server Components to Client Components as Props not working

I am getting an error when trying to pass a server component to a client component as props for a next-auth v5 in Next.js v14 implementation. I am trying to follow this pattern on the Next site https://nextjs.org/docs/app/building-your-application/rendering/composition-patterns#supported-pattern-passing-server-components-to-client-components-as-props to pass a server component to a client component. The error is:

Next.js Passing Server Components to Client Components as Props not working

I am getting an error when trying to pass a server component to a client component as props for a next-auth v5 in Next.js v14 implementation. I am trying to follow this pattern on the Next site https://nextjs.org/docs/app/building-your-application/rendering/composition-patterns#supported-pattern-passing-server-components-to-client-components-as-props to pass a server component to a client component. The error is: Error: async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding ‘use client’ to a module that was originally written for the server.