Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auth component throw error #11

Closed
fengkx opened this issue Mar 6, 2022 · 3 comments
Closed

Auth component throw error #11

fengkx opened this issue Mar 6, 2022 · 3 comments

Comments

@fengkx
Copy link

fengkx commented Mar 6, 2022

I am using Auth component in nextjs.
Provider is setting with a supabase client.

<SaasProvider theme={theme} {...createAuthService(supabase)}>
    <AuthProvider>
        <Component {...pageProps} />
    </AuthProvider>
  </SaasProvider>

I use Auth component with a github provider which is support in supabase.

<Auth
    providers={{
      google: {
          name: 'GitHub',
          icon: FaGithub
        }
      }}
      type="password"
 />

this error is thrown

Unhandled Runtime Error
TypeError: Cannot destructure property 'logIn' of 'x(...)' as it is null.

Call Stack
M
node_modules/.pnpm/@saas-ui+auth@0.6.1_ae4b258d679467cd3105b6a0b1e43c4d/node_modules/@saas-ui/auth/dist/index.modern.js (365:0)
renderWithHooks

I can only render component by removing providers props. But once I login with password.
TypeError: Cannot read properties of null (reading 'logIn')

Call Stack
eval
node_modules/.pnpm/@saas-ui+auth@0.6.1_ae4b258d679467cd3105b6a0b1e43c4d/node_modules/@saas-ui/auth/dist/index.modern.js (111:0)
eval
node_modules/.pnpm/@saas-ui+hooks@0.3.0_react@17.0.2/node_modules/@saas-ui/hooks/dist/index.modern.js (1:261)
onSubmit
node_modules/.pnpm/@saas-ui+auth@0.6.1_ae4b258d679467cd3105b6a0b1e43c4d/node_modules/@saas-ui/auth/dist/index.modern.js (270:0)
eval

this error is thrown
@fengkx
Copy link
Author

fengkx commented Mar 6, 2022

Look like the supabase service is working in progress?

@Pagebakers
Copy link
Contributor

Thanks for the report @fengkx!

Looks like there's an error in the docs, I'll get this sorted.

It should be:

<AuthProvider {...createAuthService(supabase)}>

@Pagebakers
Copy link
Contributor

Fixed the example here: https://www.saas-ui.dev/docs/auth/auth-provider

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants