Skip to content
This repository was archived by the owner on Oct 9, 2025. It is now read-only.

Using different schema for Supabase prevents build, results in errorย #478

@damywise

Description

@damywise

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

Heya, I'm having trouble trying to use different table schema using Supabase for the template refine project

// utility/supabaseClient.ts
export const supabaseClient = createClient(SUPABASE_URL, SUPABASE_KEY, {
    db: {
// problematic part vv
        schema: "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

  1. Get the Supabase refine template
  2. Change supabaseClient options schema from "public" to anything else
  3. npm run build
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions