event.locals.supabase type error
I am getting this error on my SvelteKit Auth SSR Setup. Note that this setup was from the official documentation and was working fine until now (https://supabase.com/docs/guides/auth/server-side/sveltekit):
hooks.server.ts (error scope) :
Type 'SupabaseClient<Database, "public" | "__InternalSupabase" | "graphql_public", GenericSchema, never, { PostgrestVersion: "12.2.12 (cd3cf9e)"; }>' is not assignable to type 'SupabaseClient<Database, "public", "public", { Tables: { expenses: { Row: { amount: number; category: string; created_at: string; id: string; name: string; note: string | null; status: string | null; updated_at: string; }; Insert: { ...; }; Update: { ...; }; Relationships: []; }; ... 5 more ...; vehicles: { ...; }; ...'.
Type 'GenericSchema' is not assignable to type '"public"'.ts(2322)Type 'SupabaseClient<Database, "public" | "__InternalSupabase" | "graphql_public", GenericSchema, never, { PostgrestVersion: "12.2.12 (cd3cf9e)"; }>' is not assignable to type 'SupabaseClient<Database, "public", "public", { Tables: { expenses: { Row: { amount: number; category: string; created_at: string; id: string; name: string; note: string | null; status: string | null; updated_at: string; }; Insert: { ...; }; Update: { ...; }; Relationships: []; }; ... 5 more ...; vehicles: { ...; }; ...'.
Type 'GenericSchema' is not assignable to type '"public"'.ts(2322)hooks.server.ts (error scope) :
event.locals.supabase = createServerClient(PUBLIC_SUPABASE_URL, PUBLIC_SUPABASE_PUBLISHABLE_KEY, {
cookies: {
getAll: () => event.cookies.getAll(),
/**
* SvelteKit's cookies API requires `path` to be explicitly set in
* the cookie options. Setting `path` to `/` replicates previous/
* standard behavior.
*/
setAll: (cookiesToSet) => {
cookiesToSet.forEach(({ name, value, options }) => {
event.cookies.set(name, value, { ...options, path: '/' });
});
}
}
});event.locals.supabase = createServerClient(PUBLIC_SUPABASE_URL, PUBLIC_SUPABASE_PUBLISHABLE_KEY, {
cookies: {
getAll: () => event.cookies.getAll(),
/**
* SvelteKit's cookies API requires `path` to be explicitly set in
* the cookie options. Setting `path` to `/` replicates previous/
* standard behavior.
*/
setAll: (cookiesToSet) => {
cookiesToSet.forEach(({ name, value, options }) => {
event.cookies.set(name, value, { ...options, path: '/' });
});
}
}
});
