diff --git a/.changeset/spotty-eagles-applaud.md b/.changeset/spotty-eagles-applaud.md new file mode 100644 index 0000000000..5e7e6013a8 --- /dev/null +++ b/.changeset/spotty-eagles-applaud.md @@ -0,0 +1,5 @@ +--- +'@clerk/nextjs': patch +--- + +Removing error in dev when useAuth() is not wrapped in diff --git a/packages/nextjs/src/client-boundary/PromisifiedAuthProvider.tsx b/packages/nextjs/src/client-boundary/PromisifiedAuthProvider.tsx index 10b04166bc..2e85111ca3 100644 --- a/packages/nextjs/src/client-boundary/PromisifiedAuthProvider.tsx +++ b/packages/nextjs/src/client-boundary/PromisifiedAuthProvider.tsx @@ -4,7 +4,6 @@ import { useAuth } from '@clerk/clerk-react'; import { useDerivedAuth } from '@clerk/clerk-react/internal'; import type { InitialState } from '@clerk/types'; import { useRouter } from 'next/compat/router'; -import { PHASE_PRODUCTION_BUILD } from 'next/constants'; import React from 'react'; const PromisifiedAuthContext = React.createContext | InitialState | null>(null); @@ -72,11 +71,6 @@ export function usePromisifiedAuth() { return useAuth(); } - if (!resolvedData && process.env.NEXT_PHASE !== PHASE_PRODUCTION_BUILD) { - throw new Error( - 'Clerk: useAuth() called in static mode, wrap this component in to make auth data available during server-side rendering.', - ); - } // We don't need to deal with Clerk being loaded here return useDerivedAuth(resolvedData); } else {