supabase / ssr

Supabase clients for use in server-side rendering frameworks.
MIT License
73 stars 7 forks source link

createBrowserClient is incorrectly marked as deprecated when no options object is passed in 0.4.0-rc.3 #15

Closed harrisrobin closed 4 months ago

harrisrobin commented 5 months ago

Bug report

Describe the bug

When using createBrowserClient, typescript shows me a deprecation warning due to it not having the getAll and setAll methods as discussed in https://github.com/orgs/supabase/discussions/27037, however this is only required for server clients since the browser client works with the document.cookie API by default.

note that adding an empty object as the third argument also seems to remove this warning.

To Reproduce

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

In a typescript file, simply call createBrowserClient without the third options argument:

  createBrowserClient<MyDatabase>(
    process.env.NEXT_PUBLIC_SUPABASE_URL!,
    process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!
)

Expected behavior

It should not show me a deprecated warning if i don't pass it an options object.

Screenshots

image
hf commented 4 months ago

Fixed with #17