diff --git a/packages/nextjs/src/app-router/server/auth.ts b/packages/nextjs/src/app-router/server/auth.ts index 97302ea3d7..836a27ae09 100644 --- a/packages/nextjs/src/app-router/server/auth.ts +++ b/packages/nextjs/src/app-router/server/auth.ts @@ -1,3 +1,5 @@ +import 'server-only'; + import type { AuthObject, RedirectFun } from '@clerk/backend/internal'; import { constants, createClerkRequest, createRedirect } from '@clerk/backend/internal'; import { notFound, redirect } from 'next/navigation'; diff --git a/packages/nextjs/src/app-router/server/currentUser.ts b/packages/nextjs/src/app-router/server/currentUser.ts index 4d7cb2d7be..b73d8cc708 100644 --- a/packages/nextjs/src/app-router/server/currentUser.ts +++ b/packages/nextjs/src/app-router/server/currentUser.ts @@ -1,3 +1,5 @@ +import 'server-only'; + import type { User } from '@clerk/backend'; import { clerkClient } from '../../server/clerkClient';