david-plugge / sveltekit-supabase

18 stars 1 forks source link

setupSupabase() and auth() not working #11

Closed Protract-123 closed 1 year ago

Protract-123 commented 2 years ago

When using setupSupabase() on my +layout.svelte file, when I pass in my supabase client I get an error when I open my page Error: You need to pass the your supabase instance to setClientConfig. This same bug also occurs in my hooks.server.ts file in the auth() function

To Reproduce

I used all the code which was provided in the auth part of the repository and this occurred. note: I named my supabase client "supabase" instead of "supabaseClient"

Screenshots:

Screenshot 2022-09-25 at 12 14 39 AM Screenshot 2022-09-25 at 12 15 06 AM Screenshot 2022-09-25 at 12 17 44 AM
david-plugge commented 2 years ago

setupSupabase and auth expect an object as the first parameter with a key supabaseClient. If you want something else than that you can pass it like this:

setupSupabase({
    supabaseClient: supabase,
    ...
})

However, the auth package is likely going to be removed once the supabase auth helpers are updated to work with the new sveltekit routing. I will add that in the readme.