Expo types mismatch

Hi, I want to integrate better-auth with my Expo app, I created the client exactly like in the docs, but I'm receiving still the type error:
import { createAuthClient } from "better-auth/react";
import { expoClient } from "@better-auth/expo/client";

export const authClient = createAuthClient({
baseURL: getBaseUrl(),
plugins: [
expoClient({
storage: SecureStore,
}),
],
});
import { createAuthClient } from "better-auth/react";
import { expoClient } from "@better-auth/expo/client";

export const authClient = createAuthClient({
baseURL: getBaseUrl(),
plugins: [
expoClient({
storage: SecureStore,
}),
],
});
And this is the error that goes from plugin definition:
Type 'ZodType<any, ZodTypeDef, any>' is missing the following properties from type 'ZodType<any, ZodTypeDef, any>': "~standard", "~validate"
Type 'ZodType<any, ZodTypeDef, any>' is missing the following properties from type 'ZodType<any, ZodTypeDef, any>': "~standard", "~validate"
16 Replies
luksch42
luksch422mo ago
What’s your zod version and is it consistent? Im on 3.24.1
Bart ⚡
Bart ⚡OP2mo ago
I'm on zod: 3.23.8 and it's consistent across the whole monorepo okay, the getCookie is working, but it's missing types
luksch42
luksch422mo ago
Just in case: have you tried to restart your ts server?
Bart ⚡
Bart ⚡OP2mo ago
yes, multiple times
bekacru
bekacru2mo ago
what version of better auth are you on?
Bart ⚡
Bart ⚡OP2mo ago
1.1.8 hmm, the zod update possibly fixes the types error 🤔 but now the useSession returns any, I can see that it comes from expo plugin? @bekacru
bekacru
bekacru2mo ago
make sure to set strict:true in your tsconfig and check the expo example on the main repo as a starting point
Bart ⚡
Bart ⚡OP2mo ago
yes, it's set across the whole monorepo
Bart ⚡
Bart ⚡OP2mo ago
I can see something like this
No description
Bart ⚡
Bart ⚡OP2mo ago
I think that any overwrites every type that's why it's the result
bekacru
bekacru2mo ago
does this get fixed if you remove the expoClient from the plugins list?
Bart ⚡
Bart ⚡OP2mo ago
yes:
No description
bekacru
bekacru2mo ago
hey could you try 1.1.10-beta.1 and see if it fixeds the issue
Bart ⚡
Bart ⚡OP2mo ago
for both core lib and expo plugin?
bekacru
bekacru2mo ago
just for expo. may not be released yet wait a couple minutes or so.
Bart ⚡
Bart ⚡OP2mo ago
okay, will do it later Working now!

Did you find this page helpful?