Closed wanjohiryan closed 1 month ago
I have tried using raw createClient
like so:
import { createClient } from "@supabase/supabase-js";
const supabaseClient= createClient(
import.meta.env.PUBLIC_SUPABASE_URL,
import.meta.env.PUBLIC_SUPABASE_ANON_KEY,
)
//...component wrapper goes somewhere here
useVisibleTask$(() => {
const getData = async () => {
const { data: supabaseData } = await supabaseClient.from('test').select('*');
console.log({ data });
};
getData();
}, []);
//....more component code here
And it works now. I wonder why? 🤔
Which component is affected?
Starters / CLI
Describe the bug
Hello there 👋🏾
Am using your package
supabase-auth-helpers-qwik
and I keep getting the error:On more investigation, i realised you are using
@supabase/supabase-js
which no longer comes withcreateBrowserClient
.Could you try using
@supabase/ssr
instead?EDIT: After looking at your code, i understand why you are using
@supabase/supabase-js
. However, thebrowserClient
error still persists.PS:
createServerClient
works okay for meReproduction
none
Steps to reproduce
pnpm add @supabase/supabase-js && pnpm add -D supabase-auth-helpers-qwik
supabase-auth-helpers-qwik will only work if it is a dev dependencyThen try creating a browserClient like so:
PS: Don't forget to configure the env variables accordingly.
System Info
Additional Information
I could open a PR, it will take a minute. I think 😅