https://supabase.com/ logo
Join Discord
Powered by
# help-and-questions
  • good youtube series / learning resources for react / supabase
    s

    seanee

    03/08/2023, 5:02 AM
    hey guys, I'm looking for a youtube series or tutorial series on how to use react with supabase. as a newcomer to web development and only familiar with native js, css, html. do you have someone in mind who creates great, consistent videos or publishes great tutorials? comment if you have anyone in mind :)
  • Authenticate user on server side using external JWT
    s

    squallsama

    03/08/2023, 5:03 AM
    Is it possible to authenticate user on server side using dart sdk or python sdk and externally generated JWT ?
    n
    g
    • 3
    • 4
  • React Auth-UI not showing confirmation message after signup (Next.js)
    s

    stylishbob

    03/08/2023, 5:16 AM
    After filling in the email and password, I am not able to see a confirmation message saying that a email has been sent to my account. I do receive the confirmation email but no feedback on the UI. Subsequent clicks show the throttle error message. I've made sure to make the
    Auth
    component be lazily loaded with
    ssr: false
    as well.
    s
    • 2
    • 1
  • Has anyone been able to embed reverse image search in their web app using supabase?
    c

    czypnt

    03/08/2023, 5:29 AM
    Or even implementing Google Vision AI?
  • client-side data fetch with RLS.
    j

    JackBiscuits

    03/08/2023, 7:37 AM
    Hello, i am trying to follow this guide auth-helpers, but whre does this code belong?
    j
    • 2
    • 1
  • supabaseUrl is require React (Error).
    k

    killerthief

    03/08/2023, 7:47 AM
    Hi I have been working with VERCEL REACT AND SUPABASE , however I am unable to deploy it . I was following the guide provided by the Supabase . It keeps throwing an error supabase is required , after investigating I am pretty sure it is unable to detect the URL AND ANON KEY as when I put the anon key and url directly it works just fine , it worked fine even when my .env.local just had the two however ones more elements came in "NEXT_PUBLIC_SUPABASE_URL , NEXT_PUBLIC_SUPABASE_ANON_KE" and even the vercel thing it stopped working I am not sure why ? If anyone knows please do let me know thanks
    s
    • 2
    • 20
  • [SvelteKit] Issue with TypeError: getSession is not a function
    e

    Entropy

    03/08/2023, 7:48 AM
    Hello! I was following the documentation to setup SvelteKit auth using the auth helper. Though whenever I try to run the application I get a type error saying that getSession is not a function in my
    +layout.server.ts
    . I checked out the types and everything looks fine to me. Here's a link to an github with all my code: https://github.com/Entropy-10/sveltekit-auth-helper-issue
    s
    a
    • 3
    • 4
  • More than one relationship was found (Many To Many)
    k

    Kazuto

    03/08/2023, 10:21 AM
    Hey guys, I can't figure out how to query the relation properly. I've got three tables:
    shows
    ,
    movies
    and
    genres
    and two intermediate tables
    genre_movie
    and
    genre_show
    . Both intermediate tables contain two columns: `genre_movie`:
    Copy code
    sql
    CREATE TABLE "public"."genre_movie" (
        "genre_id" uuid REFERENCES "public"."genres" NOT NULL,
        "movie_id" uuid REFERENCES "public"."movies" NOT NULL,
        CONSTRAINT fk_genre FOREIGN KEY(genre_id) REFERENCES genres(id),
        CONSTRAINT fk_movie FOREIGN KEY(movie_id) REFERENCES movies(id),
        PRIMARY KEY (genre_id, movie_id)
    );
    
    CREATE TABLE "public"."genre_show" (
        "genre_id" uuid REFERENCES "public"."genres" NOT NULL,
        "show_id" uuid REFERENCES "public"."shows" NOT NULL,
        CONSTRAINT fk_genre FOREIGN KEY(genre_id) REFERENCES genres(id),
        CONSTRAINT fk_show FOREIGN KEY(show_id) REFERENCES shows(id),
        PRIMARY KEY (genre_id, show_id)
    );
    But I'm not able to get the genres through the
    select()
    statement.
    select('*, genres(*)')
    results in
    Copy code
    Try changing 'genres' to one of the following: 'genres!genre_show', 'genres!genre_show', 'genres!genre_show', 'genres!genre_show'. Find the desired relationship in the 'details' key.
    
    Could not embed because more than one relationship was found for 'shows' and 'genres'
    select('*, genres!genre_show')
    results in
    Copy code
    unexpected end of input expecting letter, digit, "-", "!" or "("
    and
    select('*, genres!genre_show(*)')
    results again in
    Copy code
    Try changing 'genres' to one of the following: 'genres!genre_show', 'genres!genre_show', 'genres!genre_show', 'genres!genre_show'. Find the desired relationship in the 'details' key.
    
    Could not embed because more than one relationship was found for 'shows' and 'genres'
    • 1
    • 2
  • Deleting Supabase View
    s

    SELIM HÜR

    03/08/2023, 1:31 PM
    Hi Experts, how can i delete and change views
    g
    • 2
    • 2
  • Network request failed
    t

    Trevvy

    03/08/2023, 1:39 PM
    Unable to login a user:
    Copy code
    js
    const { data, error } = await supabase.auth.signInWithPassword({
                email,
                password,
            });
    What's wrong?
    g
    e
    • 3
    • 26
  • View SQL Logs local development
    v

    viktor

    03/08/2023, 1:47 PM
    For debugging purposes I have set
    Copy code
    sql
    ALTER SYSTEM SET log_statement = 'all';
    How/where can I view the generated logs? I'm using local development as described here: https://supabase.com/docs/guides/cli/local-development
    n
    • 2
    • 3
  • starting latest supabase fails
    s

    sigma-andex

    03/08/2023, 1:56 PM
    I just updated supabase using
    brew upgrade supabase
    to 1.42.3 and now I'm getting an error when running `supabase start`:
    Copy code
    Error: ERROR: role "pgbouncer" already exists (SQLSTATE 42710)
    At statement 11: CREATE ROLE pgbouncer
    How can I fix this?
    • 1
    • 1
  • Dynamic routs error in Next.js-13
    j

    JY

    03/08/2023, 2:21 PM
    Browser is yelling
    Copy code
    "Unhandled Runtime Error
    Error: Dynamic server usage: revalidate: 0 configured "
    . Both Rootlayout and '/app/posts/page.tsx' set
    "export const revalidate = 0"
    . Below are the codes in /app/posts/[id]/page.tsx
    Copy code
    import "server-only";
    import { notFound } from "next/navigation";
    import { supabase } from "@/utils/supabase";
    
    export async function generateStaticParams() {
      const { data: posts } = await supabase.from("posts").select("id");
      console.log("posts", posts);
      return posts
        ? posts.map((post) => ({
            id: post.id.toString(),
          }))
        : [];
    }
    export let revalidate = 0;
    
    export default async function Post({
      params: { id },
    }: {
      params: { id: string };
    }) {
      const { data: post } = await supabase
        .from("posts")
        .select()
        .match({ id })
        .single();
      if (!post) {
        notFound();
      }
      // console.log("post", post);
      return <pre>{JSON.stringify({ post }, null, 2)}</pre>;
    }
    • 1
    • 1
  • Invite only registration using invite codes
    u

    1nf

    03/08/2023, 2:29 PM
    Anyone know how I could implement invite only registration using invite codes on supabase? Want to control the initial influx of users by allowing them to invite each other
    n
    • 2
    • 1
  • Pagedata unexpected token
    j

    JackBiscuits

    03/08/2023, 3:29 PM
    Hello, I get the following error when i follow the Auth tutorial: "Build a User Management App with SvelteKit":
    Copy code
    [plugin:vite-plugin-svelte] /src/routes/+page.svelte:15:13 Unexpected token
    /src/routes/+page.svelte:15:13
    
     15 |    import type { PageData } from './$types'; 
                         ^
    Why is PageData an unexpected token?
    g
    • 2
    • 4
  • Is there an updated guide on snaplet integration? It's broken for me.
    o

    ostoto

    03/08/2023, 3:37 PM
    I followed this guide https://supabase.com/docs/guides/integrations/snaplet#34-restore-to-the-data-target, but am unable to assign superuser privileges. I proceeded with the rest of the steps and now I'm unable to query using supabase-js from the frontend due to 401 errors.
    g
    u
    • 3
    • 3
  • Connecting Storage API to AWS S3
    m

    Mohannad Hussain

    03/08/2023, 3:43 PM
    Hello all, I am new to supabase so apologies in advance if this is a dumb question. I am using the self-hosted (i.e. docker compose) version of supabase to develop on my laptop and I would like to integrate the storage component with S3, but unfortunately nothing I am trying seems to work. The documentation at https://github.com/supabase/storage-api seems to suggest you just need to get AWS authentication, then initialize a bunch of environment variables for things like Global S3 bucket, AWS region. I've tried a wide variety of environment variables as per that documentation as well as other places (e.g. GitHub issues) to no avail. I have even tried mapping a
    credentials
    file into the storage container as per https://github.com/supabase/storage-api/issues/135 and again, still no luck. Any thoughts on what I might be doing wrong? Thanks in advance for any assistance.
    g
    d
    • 3
    • 5
  • Did the JWT secret format change in the past year?
    d

    Derek

    03/08/2023, 3:45 PM
    I've just made a new JWT secret and it appears to be longer and possibly b64 encoded compared to the initial JWT secret that was generated over a year ago. Have some code on a python cloud function where calls are authenticated by the JWT, currently unable to verify the JWT signature with the newly generated JWT secret. Anyone else have this problem?
    g
    • 2
    • 2
  • PK, FK and hierarchy
    f

    Fayyaz

    03/08/2023, 4:20 PM
    I am designing a database in Postgresql, I have three tables, Category, SubCategory and Products. I have CategoryId as F_key in SubCategory and CategoryId, SubCategoryId as two F_keys in Products table. Is it something advisable or should I have only one F_Key SubCategryId in Products table?
    g
    • 2
    • 3
  • How are connections counted on the Roles page?
    i

    InASunshineState

    03/08/2023, 4:28 PM
    We only have four people logged in and 36 of 90 connections are showing as active; the glowing/blinking green dot suggest it's a live tally. I know a user isn't a connection and that connections get pooled, and those four people could be scooting between pages, but it makes me nervous that things will grind to a halt when the very realistic situation of, say, eight people being on the site at once comes through. I'm getting nervous flashbacks to limited PHP workers.
    g
    • 2
    • 6
  • gen_random_bytes(int) does not exist (Self hosted Supabase)
    s

    SunTzu

    03/08/2023, 4:45 PM
    Hello! I have a column in my table that generates a random code. For this I found a snippet online with the following:
    Copy code
    CREATE OR REPLACE FUNCTION generate_uid(size INT) RETURNS TEXT AS $$
    DECLARE
      characters TEXT := 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
      bytes BYTEA := gen_random_bytes(size);
      l INT := length(characters);
      i INT := 0;
      output TEXT := '';
    BEGIN
      WHILE i < size LOOP
        output := output || substr(characters, get_byte(bytes, i) % l + 1, 1);
        i := i + 1;
      END LOOP;
      RETURN output;
    END;
    $$ LANGUAGE plpgsql VOLATILE;
    This works on the supabase hosted database I tried it on, however does not work with self hosted solution, and when it tries to trigger this function it states that gen_random_bytes does not exist anything I can dO?
    g
    • 2
    • 3
  • Can I set RLS using the CLI?
    h

    horigome

    03/08/2023, 4:51 PM
    I am keen on using Supabase in my next BIG project but would like to know if I am able to use the CLI instead of the website? Like, could I 100% rely on code to configure RLS and all Supabase related code, or will I need to move back and forth between my code repo and the Supabase web config? I guess what I am asking that in the perfect world I would like to have migration files and stuff to work with Supabase config stuff just as I would use Prisma for db migration stuff. I want a single source of truth, use my code editor and git repo.
    g
    s
    • 3
    • 11
  • Reverse project migration from latest to previous version
    k

    Kcrik

    03/08/2023, 4:54 PM
    Hello, We migrated one of our project today from Postgre 14 to 15. The problem is it's causing us quite a lot of issues. We are wondering if it's possible to reverse that update somehow ? (Ideally via the UI). It's a project part of our Free Tier Thanks. Chris
    s
    • 2
    • 7
  • Setting up admin roles
    j

    jinsley8

    03/08/2023, 5:09 PM
    I have a custom auth setup using next-auth and supabase - very similar to what is outliend here: https://next-auth.js.org/adapters/supabase#create-the-next_auth-schema-in-supabase Now I want to create a new admin dashboard app that uses the regular supabase auth. I'm assuming using the regular auth still works because it hasn't been changed at all. Questions - I'm sure it's been asked but I can't find it: 1) Does supabase have a built in admin user role or do I need to set one up? 2) Only admins can register and login on the admin app. What's the best what to do this without bots and others trying to register? Can I create new users from the supabase dashboard UI and not add a registration page at all, only login? Or allow anyone to register if they know the register page but have a separate user table column with a boolean like "approved" and handle that manually? If I want to have only phone or google login can I restrict the specific phone numbers or gmail accounts allowed? Any other suggestions? It mostly read-only, the few times I'd need to insert or update something I can just do it from the Supabase tables UI.
    m
    • 2
    • 1
  • realtime mistery !
    r

    RubensNobre

    03/08/2023, 5:50 PM
    ## Can anyone help me unravel a mystery? I have a react com context provider and I'm subscribed to a channel, as the documentation says. Data update and receive events in all tables except one. My 'profile' table simply doesn't send 'postgres_changes' events. All others work perfectly. I've tried everything.... Does anyone have any tips, what else I can try to do?? here's my current code.
    Copy code
    const realtimeProfile = supabase
          .channel("realtimeUserProfile")
          .on(
            "postgres_changes",
            { event: "UPDATE", schema: "public", table: "profile" },
            (payload) => {
              console.log("profile change received!", payload);
            setUser((prevUser: any) => ({
              ...prevUser,
              profile: { ...prevUser.user_items, ...payload.new },
            }));
            }
          )
          .on(
            "postgres_changes",
            { event: "INSERT", schema: "public", table: "user_items" },
            (payload) => {
              console.log("New user item received!", payload);
              setUser((prevUser: any) => ({
                ...prevUser,
                user_items: { ...prevUser.user_items, ...payload.new },
              }));
            }
          )
          .on(
            "postgres_changes",
            { event: "UPDATE", schema: "public", table: "user_items", filter: 'username=eq.rubensnobre' },
            (payload) => {
              console.log("User item change received!", payload);
              alert('userId = ' + JSON.stringify(user))
            setUser((prevUser: any) => ({
              ...prevUser,
              user_items: { ...prevUser.user_items, ...payload.new },
            }));
            }
          )
          .on(
            "postgres_changes",
            { event: "DELETE", schema: "public", table: "user_items" },
            (payload) => {
              console.log("User item deleted!", payload);
            setUser((prevUser: any) => ({
              ...prevUser,
              user_items: { ...prevUser.user_items, ...payload.new },
            }));
            }
          )
          .subscribe();
    g
    b
    • 3
    • 41
  • Payload "old" object only returns id on UPDATES
    a

    Ari

    03/08/2023, 6:27 PM
    Hi, I was wondering if there is a way to have the "old" object return the entire row instead of just the id when listening in on an UPDATE. Thank you
    g
    • 2
    • 3
  • Keep local & production container image versions in sync
    d

    Dallas

    03/08/2023, 7:33 PM
    I've run into this problem today after updating my supabase CLI version. In updating the CLI, when I run my local supabase server for dev work, it's using the latest versions of all the supabase docker images. On one hand, this is great since now I have all the latest updates and changes to the platform, but it has posed a new problem. Code that used to work (and still works on the cloud-hosted production instance) no longer works on my local development because of changes inside these containers. For example, in the older version I was running on, doing a join from the js client would result in an array result on the join, even if the relationship was a 1-1. In the new version that the CLI has pulled now, that join now returns the plain object, no longer wrapped in array. I can go through my project and code against that specific case, but I only point it out as an example. So my question then, how can I (or even should I) keep my local development container images in sync with my cloud-hosted versions? I haven't found any docs around how to specify the container image versions and they seem tied to the CLI version you have installed. I'm not even sure how I would know what exactly my production system is running other than the postgres version which is displayed in the dashboard. This feels like a problem that probably already has a solution, I just haven't been able to track anything down for it. Thanks!
  • Can't connect to supabase DB from external sources
    r

    rbl

    03/08/2023, 7:43 PM
    I'm trying to sync my postgres DB within supabse to customer.io to sync customer attributes: I put in all the credentials from https://app.supabase.com/project//settings/database DATABASE NAME postgres HOST db..supabase.co PORT 5432 USERNAME postgres PASSWORD SSL ON/OFF (tried both and neither work) Customer.io says: Update your firewall to allow connections to your database from Customer.io IPs: 34.122.196.49 Why can't I connect to my DB?
    g
    • 2
    • 4
  • not getting any events from onAuthStateChanged in the flutter client
    a

    athomas

    03/08/2023, 7:45 PM
    pretty self explanatory, I'm listening to the onAuthStateChanged stream in the flutter client and I'm not receiving any events from it, I've updated all of my dependencies etc, wiped the memory of my test devices, still nothing
    j
    s
    +2
    • 5
    • 5
  • 3rd Parth Auth Link Icon Sizing
    m

    Modfreq

    03/08/2023, 7:46 PM
    Why are the icons for the 3rd party auth links set to 512x512 px??? It causes a flash on NextJS because they render much smaller. How do I fix that? and again... why?
    s
    • 2
    • 2
1...159160161...230Latest