You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I include the SignOut button in my nextJS build I am unable to proceed with my build due to build errors. Am I missing something or doing something wrong here? Or some config I need to change? Seems like the issue is in the way the Impersonation function tries to use 'use server' in-line which nextJS compiler doesn't like.
Update: Actually it stops me from using withAuth() as well.
Build Error
Failed to compile.
./node_modules/@workos-inc/authkit-nextjs/dist/esm/impersonation.js
Error: x It is not allowed to define inline "use server" annotated Server Actions in Client Components.
| To use Server Actions in a Client Component, you can either export them from a separate file with "use server" at the top, or pass them down through props from a Server Component.
47 | lineHeight: '1.4',
48 | } },
49 | React.createElement("form", { action: async () => {
50 | 'use server';
: ^^^^^^^^^^^^
51 | await signOut();
52 | }, style: {
53 | display: 'flex',
Sign Out Function
import { signOut } from "@workos-inc/authkit-nextjs";
export async function handleSignOut() {
await signOut();
}
When I include the SignOut button in my nextJS build I am unable to proceed with my build due to build errors. Am I missing something or doing something wrong here? Or some config I need to change? Seems like the issue is in the way the Impersonation function tries to use 'use server' in-line which nextJS compiler doesn't like.
Update: Actually it stops me from using withAuth() as well.
Build Error
Sign Out Function
Use In Component
The text was updated successfully, but these errors were encountered: