You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Heya, I'm having trouble trying to use different table schema using Supabase for the template refine project
// utility/supabaseClient.tsexportconstsupabaseClient=createClient(SUPABASE_URL,SUPABASE_KEY,{db: {// problematic part vvschema: "custom",},auth: {persistSession: true,},});
That exact code results in the following error.
22:08:57.278 Executing user command: npm run build
22:08:57.892
22:08:57.892 >[email protected] build
22:08:57.892 > tsc && refine build
22:08:57.892
22:09:02.920 src/App.tsx(328,48): error TS2345: Argument of type'SupabaseClient<any, "custom", any>' is not assignable to parameter of type'SupabaseClient<any, "public", any>'.
22:09:02.921 Type '"custom"' is not assignable to type'"public"'.
22:09:02.921 src/App.tsx(329,48): error TS2345: Argument of type'SupabaseClient<any, "custom", any>' is not assignable to parameter of type'SupabaseClient<any, "public", any>'.
22:09:02.967 Failed: build command exited with code: 2
22:09:03.827 Failed: error occurred while running build command
To Reproduce
Get the Supabase refine template
Change supabaseClient options schema from "public" to anything else
npm run build
Error
Expected behavior
Works
Screenshots
If applicable, add screenshots to help explain your problem.
System information
OS: macOS
Browser (if applies): any
Version of supabase-js: ^2.7.0
Version of Node.js: v18.17.1
Additional context
Type '"product"' is not assignable to type '"public"'.ts(2322)
---
(property) schema?: ("public" extends keyof Database ? "public" : string & keyof Database) | undefined
Also npm start works but npm run build doesn't
The text was updated successfully, but these errors were encountered:
Running into the same problem. It's a blocker for running Edge Function tests as well if I need to create a client and use data in a non-public schema.
error: TS2322 [ERROR]: Type 'SupabaseClient<any, string, any>' is not assignable to type 'SupabaseClient<any, "public", any>'.
Type 'string' is not assignable to type '"public"'.
var client: SupabaseClient = createClient(supabaseUrl, supabaseKey, options) // options has db: { schema: 'my-schema' }
~~~~~~
It seems that the typing only allow public if public is a key of Database. Otherwise, it would allow the schema to be all possible keys of Database. Hence, the removal of the key public above.
Bug report
Describe the bug
Heya, I'm having trouble trying to use different table schema using Supabase for the template refine project
That exact code results in the following error.
To Reproduce
npm run build
Expected behavior
Works
Screenshots
If applicable, add screenshots to help explain your problem.
System information
Additional context
Also
npm start
works butnpm run build
doesn'tThe text was updated successfully, but these errors were encountered: