You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem is that I want to set a custom schema in src/hooks.server.ts
event.locals.supabase=createServerClient(PUBLIC_SUPABASE_URL,PUBLIC_SUPABASE_ANON_KEY,{db: {schema: 'myschema'},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: '/'})})},},})
But this clashes with the supabase client definition in src/app.d.ts
Type 'SupabaseClient<any, "myschema", any>' is not assignable to type 'SupabaseClient<any, "public", any>'.
Type '"myschema"' is not assignable to type '"public"'.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
My codebase is svelte-5 with typescript.
I'm following this guide https://supabase.com/docs/guides/auth/server-side/sveltekit
The problem is that I want to set a custom schema in
src/hooks.server.ts
But this clashes with the supabase client definition in
src/app.d.ts
The error that I get is :
Beta Was this translation helpful? Give feedback.
All reactions