iuioiuaI
Denoβ€’3y agoβ€’
9 replies
iuioiua

Supabase Auth UI in Fresh

I'm building a simple web. I'd like to use Supabase's Auth UI, namely the Auth component, for handling the login and signup forms. I'd like to get the following working:
import { Auth } from "https://esm.sh/@supabase/auth-ui-react@0.2.6";
import { createClient } from "https://esm.sh/@supabase/supabase-js@2.7.0?alias=react:preact/compat&deps=preact@10.12.0";

const supabaseClient = createClient(
  Deno.env.get("SUPABASE_URL")!,
  Deno.env.get("SUPABASE_ANON_KEY")!,
);

export default function LoginPage() {
  return <Auth supabaseClient={supabaseClient} />;
}


However, I get the following error:
An error occurred during route handling or page rendering. TypeError: Cannot read properties of null (reading 'useState')
    at n.useState (https://esm.sh/stable/react@18.2.0/deno/react.js:2:6785)
    at Object.ee (https://esm.sh/v106/@supabase/auth-ui-react@0.2.6/deno/auth-ui-react.js:2:40881)
    at https://esm.sh/v106/preact-render-to-string@5.2.6/X-ZS8q/deno/preact-render-to-string.js:12:1830
    at T (https://esm.sh/v106/preact-render-to-string@5.2.6/X-ZS8q/deno/preact-render-to-string.js:12:1857)
    at T (https://esm.sh/v106/preact-render-to-string@5.2.6/X-ZS8q/deno/preact-render-to-string.js:12:1933)
    at T (https://esm.sh/v106/preact-render-to-string@5.2.6/X-ZS8q/deno/preact-render-to-string.js:12:1074)
    at T (https://esm.sh/v106/preact-render-to-string@5.2.6/X-ZS8q/deno/preact-render-to-string.js:12:1933)
    at T (https://esm.sh/v106/preact-render-to-string@5.2.6/X-ZS8q/deno/preact-render-to-string.js:12:1933)
    at T (https://esm.sh/v106/preact-render-to-string@5.2.6/X-ZS8q/deno/preact-render-to-string.js:12:1933)
    at T (https://esm.sh/v106/preact-render-to-string@5.2.6/X-ZS8q/deno/preact-render-to-string.js:12:1933)


How can I get this page working? I suspect a tweak is needed to bridge some compatibility gap.
Was this page helpful?