Skip to content

Superbase client does not seem to infer types correctly #6145

@damiensedgwick

Description

@damiensedgwick

Which project does this relate to?

Start

Describe the bug

This issue relates to the supabase basic example. When generating types and passing the Database generic into to the client initialisation, TypeScript is unable to infer the data types correctly.

Your Example Website or App

https://github.com/damiensedgwick/type-safe-supa-repro

Steps to Reproduce the Bug or Issue

  1. create a new start project using the supabase project
  2. create a new supabase project
  3. update env variables
  4. create a new table with a single column for testing
  5. generate types using the cli
  6. pass the database generic to the supabase client function
  7. try to write a insert statement

Expected behavior

As a user I would expect that I get auto complete, type inference and solid typing to ensure I am building robust applications.

Screenshots or Videos

No response

Platform

"dependencies": {
    "@supabase/ssr": "^0.5.2",
    "@supabase/supabase-js": "^2.48.1",
    "@tanstack/react-router": "^1.141.6",
    "@tanstack/react-router-devtools": "^1.141.6",
    "@tanstack/react-start": "^1.141.7",
    "react": "^19.0.0",
    "react-dom": "^19.0.0",
    "redaxios": "^0.5.1"
  },
  "devDependencies": {
    "@tailwindcss/postcss": "^4.1.15",
    "@types/react": "^19.0.8",
    "@types/react-dom": "^19.0.3",
    "@vitejs/plugin-react": "^4.3.4",
    "postcss": "^8.5.1",
    "tailwindcss": "^4.1.17",
    "typescript": "^5.7.2",
    "vite": "^7.1.7",
    "vite-tsconfig-paths": "^5.1.4"
  }

Additional context

Discord chat here with additional screenshots: https://discord.com/channels/719702312431386674/1450958908863680673/1450958908863680673

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions