ยฉ 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabaseโ€ข6mo agoโ€ข
11 replies
nameless

Supabase DB ts typos error

Im facing a typo problem.
Seems like supabase instances from createClient<Database>(); fails to inherit types.

I flushed my database and cleared the migrations.
Deleted docker supabase instance and deleted, installed and updated node modules.
Problem still persists.

Here is an example:

// client.ts
"use server";

import { cookies } from "next/headers";
import { createServerClient } from "@supabase/ssr";
import { Database } from "../database.types";

export default async function createClient() {
  const cookieStore = await cookies();

  return createServerClient<Database>(
    process.env.NEXT_PUBLIC_SUPABASE_URL,
    process.env.NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY,
    {
      cookies: {
        getAll() {
          return cookieStore.getAll();
        },
        setAll(cookiesToSet) {
          try {
            cookiesToSet.forEach(({ name, value, options }) =>
              cookieStore.set(name, value, options)
            );
          } catch {
          }
        },
      },
    }
  );
}

// database.types.ts


// somewhere.ts
const supabase = await createClient();
const { error } = await supabase.rpc("complete_task", { 
  p_task_id: Number(taskId) // <-- Argument of type '{ p_task_id: number; }' is not assignable to parameter of type 'undefined'.ts(2345)
});

// database.types.ts
Functions: {
  complete_task: {
    Args: { p_task_id: number }
    Returns: undefined
  }
// ...
}
// client.ts
"use server";

import { cookies } from "next/headers";
import { createServerClient } from "@supabase/ssr";
import { Database } from "../database.types";

export default async function createClient() {
  const cookieStore = await cookies();

  return createServerClient<Database>(
    process.env.NEXT_PUBLIC_SUPABASE_URL,
    process.env.NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY,
    {
      cookies: {
        getAll() {
          return cookieStore.getAll();
        },
        setAll(cookiesToSet) {
          try {
            cookiesToSet.forEach(({ name, value, options }) =>
              cookieStore.set(name, value, options)
            );
          } catch {
          }
        },
      },
    }
  );
}

// database.types.ts


// somewhere.ts
const supabase = await createClient();
const { error } = await supabase.rpc("complete_task", { 
  p_task_id: Number(taskId) // <-- Argument of type '{ p_task_id: number; }' is not assignable to parameter of type 'undefined'.ts(2345)
});

// database.types.ts
Functions: {
  complete_task: {
    Args: { p_task_id: number }
    Returns: undefined
  }
// ...
}


Also i dont have code completions on crud using client based functions like from().insert() and etc.
On from().select(), typos are never and on rpc() typos are undefined.
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Coolify supabase setup db error
SupabaseSSupabase / help-and-questions
2mo ago
Supabase db pull, cast error
SupabaseSSupabase / help-and-questions
5mo ago
Supabase DB Problems
SupabaseSSupabase / help-and-questions
5mo ago
supabase db diff
SupabaseSSupabase / help-and-questions
7mo ago