useSession is not is not callable ?

need help with the clients hooks every client hook gives me a typescript error like this This expression is not callable. No constituent of type 'Atom<{ data: { session: { userAgent: string | null | undefined; id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; }; user: { ...; }; } | null; error: BetterFetchError | null; isPending: boolean; }>' is callable.ts(2349)
Solution:
My guess is your auth client is importing createAuthClient from better-auth/client rather than better-auth/react
Jump to solution
6 Replies
Maqed
Maqed•2w ago
Please provide your setup. I.e: auth.ts and auth-client.ts
KiNFiSH
KiNFiSH•2w ago
probably hook is an issue , you should be using a the hook with in react component if you dont want to use it there , make sure to call it on server with auth.api.getSession() as well
Solution
Ping
Ping•2w ago
My guess is your auth client is importing createAuthClient from better-auth/client rather than better-auth/react
Ping
Ping•2w ago
@Ashraf Elshaer
Ashraf Elshaer
Ashraf ElshaerOP•2w ago
That was the problem thanks A lot for your help
Ping
Ping•2w ago
🫡

Did you find this page helpful?