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

Injecting type definitions does not work #407

Closed
TomsPoint opened this issue Dec 27, 2022 · 4 comments
Closed

Injecting type definitions does not work #407

TomsPoint opened this issue Dec 27, 2022 · 4 comments

Comments

@TomsPoint
Copy link

Bug report / Feature request

Describe the bug / missing feature

Typescript throws error "Expected 0 type arguments, but got 1" and types do not get injected when import { createClient } from "@supabase/auth-helpers-sveltekit"

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

`
import { createClient } from "@supabase/auth-helpers-sveltekit"
import type { Database } from "./database.types";

export const supabaseClient = createClient{PUBLIC_SUPABASE_URL, PUBLIC_SUPABASE_ANON_KEY,}
`

Expected behavior

Same behaviour when importing { createClient } from "@supabase/supabase-js"

System information

  • Version of supabase-js': 2.2.2
  • Version of auth-helpers-sveltekit': 0.8.6
  • Version of sveltekit: 1.0.0

Additional context

When importing from "@supabase/supabase-js" type injecting works but logout functionality does not work any more

Workaround

Create 2 clients one with the import from "@supabase/supabase-js" and one with the import from "@supabase/auth-helpers-sveltekit"

@alvinsga
Copy link

Any update on when this will be fixed?

@david-plugge
Copy link
Collaborator

The types must be injected into src/app.d.ts

https://supabase.com/docs/guides/auth/auth-helpers/sveltekit#typings

This way you get autocompletion in every place without the need of passing the database types

@TomsPoint
Copy link
Author

Thx @david-plugge that works :)

@mmmmillar
Copy link

Is there something else you need to run to make this work? Have updated app.d.ts but still getting the error

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

4 participants