https://supabase.com/ logo
Join Discord
Powered by
# help-and-questions
  • Not getting an error when registering with an email that is already registered?
    p

    pippin_mole

    04/22/2023, 3:59 PM
    The image shows me submitting a sign up request using an email that already exists in the users table. I would like to show an error to the user saying ``Account with that email exists``. Strange behaviour?

    https://cdn.discordapp.com/attachments/1099363890833408112/1099363891064098928/Screenshot_2023-04-22_at_16.png▾

    https://cdn.discordapp.com/attachments/1099363890833408112/1099363891328319548/Screenshot_2023-04-22_at_16.59.31.png▾

    g
    • 2
    • 4
  • Trying to add new policy to a new table
    n

    Noah

    04/22/2023, 4:13 PM
    I am trying to just add any policy to a new table i created, and I am getting this error "Error adding policy: failed to create pg.policies: must be owner of table domains". But when i check the tableowner its me the "supabase_admin" which should have access to make a simple policy. Any ideas?
    g
    • 2
    • 7
  • user validation on my graphql endpoint
    f

    fred kufner

    04/22/2023, 4:15 PM
    I have a graphql endpoint (not on supabase) that I want to lock down. I have previously used a user token (auth0) and now I want to use something from the logged in user from supabase , in my vue app, to pass to the graphql endpoint where I will call supabaseClient.auth.api.getUser(token). Assuming I am not off base in this approach, What is the best way to get the token for the user on the client that I can pass along in the headers. I see access_token being sent on the return URL after user clicks on magic link to sign in, but if a user is already logged in (e.g. after refreshing browser), how can I get this token? this way? const session = this.$supabase.auth.session(); if (session){ const token = session.access_token; this.access_token = token; }
    g
    • 2
    • 1
  • auth.uid() comparison not working ?
    n

    Nokorbis

    04/22/2023, 5:00 PM
    I'm having a weird issue that I don't understand. I've created a table
    user_permission
    that contains an access list for my users. When I compare the id stored in this table with the id returned by auth.uid(), it never works. When I compare the id with the string matching the user_id, it works. I encountered the issue first with RLS, but with the idea to find the cause I created 2 stored procedures (both configured with SQL language) that I call within my browser. The first one ("is_animator") is the one I first used in the RLS but I now call through supabase.rpc('...') (in js code).
    Copy code
    sql
    SELECT EXISTS (SELECT 1 from user_permission WHERE is_animator = true AND user_id = auth.uid())
    The second stored procedure ("test_uid') is :
    Copy code
    sql
    SELECT auth.uid();
    When I call supabase.rpc('test_uid'), I get the result I expect :
    "f07d5cd9-8b83-4c62-9140-c62630e58497"
    When I call supabase.rpc('is_animator'), I get
    false
    while in my database, I do have a record with this user_id. Any idea what might be the cause ?
    • 1
    • 4
  • pg_tle on local supabase
    a

    aslakoam

    04/22/2023, 10:33 PM
    Hi all, I've installed the latest supabase locally (1.50.11), but it doesn't have the pg_tle extension, which is needed to install supabase-dbdev. Any pointers?
    s
    • 2
    • 4
  • Error P1001
    u

    20lentin

    04/22/2023, 11:49 PM
    I cannot reach the database server after I changed the password. I'm working on a school project with 3 other members, initially only one member couldn't connect after I had reset the password once. I tried to reset it again, perhaps it could help. Now we're 3/4 who can't connect to the database (one person still can and is doing so though) and we still get error P1001 for some reason. On the online dashboard, I can still add columns/rows but default values are not applied somehow, when I try to add a row. Ah yes, we're using Prisma to connect from our nextjs project. I'm quite new to web development (still a student) so if there's anything I missed I'll gladly take it :) Thank you!
    n
    • 2
    • 1
  • Realtime in table views
    s

    saule

    04/23/2023, 12:48 AM
    Is it posible to have realtime functionality in custom table views?
    g
    • 2
    • 2
  • tables not exposed in api
    n

    naveeng2402

    04/23/2023, 1:42 AM
    How to add a table using SQL that exposes a table to rest API and graphql, simply running the create command doesn't expose the tables in api, on some research found that the permissions must be updated, but failed to make the tables available via graphql
  • Not able to create a webhook in local instance
    v

    ven

    04/23/2023, 2:12 AM
    Hello , I get a
    Copy code
    Failed to retrieve database webhooks
    error. pls see attached clip. Is that feature not currently available for local development?

    https://cdn.discordapp.com/attachments/1099518136589496423/1099518225219321896/supabase_local_webhooks.jpg▾

    g
    t
    • 3
    • 5
  • Error bundling edge function
    f

    Franck

    04/23/2023, 4:09 AM
    Hi, I'm trying to deploy an edge function that includes the following dependencies:
    Copy code
    ts
    import { createClient } from "https://esm.sh/@supabase/supabase-js@2.21.0";
    import { serve } from "https://deno.land/std@0.168.0/http/server.ts";
    import sgMail from "https://esm.sh/@sendgrid/mail@7.7.0";
    import dayjs from "https://esm.sh/dayjs@1.11.7";
    Although, I'm getting the following error that seems related to the
    @sendgrid/mail
    import:
    Copy code
    bash
    Error: Error bundling function: exit status 1
    file:///src/import_map.json
    file:///src/index.ts
    error: Uncaught (in promise) Error: Relative import path "https" not prefixed with / or ./ or ../ and not in import map from "https://esm.sh/v117/@types/node@18.15.13/https.d.ts"
          const ret = new Error(getStringFromWasm0(arg0, arg1));
                      ^
        at __wbg_new_8d2af00bc1e329ee (https://deno.land/x/eszip@v0.30.0/eszip_wasm.generated.js:312:19)
        at <anonymous> (https://deno.land/x/eszip@v0.30.0/eszip_wasm_bg.wasm:1:79439)
        at <anonymous> (https://deno.land/x/eszip@v0.30.0/eszip_wasm_bg.wasm:1:1388039)
        at <anonymous> (https://deno.land/x/eszip@v0.30.0/eszip_wasm_bg.wasm:1:1862894)
        at __wbg_adapter_18 (https://deno.land/x/eszip@v0.30.0/eszip_wasm.generated.js:146:6)
        at real (https://deno.land/x/eszip@v0.30.0/eszip_wasm.generated.js:130:14)
    Any recommendation on how to solve this? Thanks
  • it is possible to add a policy that allows users to see certain columns?
    m

    miguelmichelson

    04/23/2023, 5:22 AM
    wondering if I can avoid the select("*") and only allow for some fields to be public.
    m
    y
    • 3
    • 3
  • How do I actually restore my DB after a supabase stop --backup ?
    t

    tristansinclair

    04/23/2023, 6:55 AM
    After running
    supabase stop --backup
    and creating a DB backup, how can I actually restore this data when I want to start up again?
    • 1
    • 1
  • How do you get a Supacap?
    d

    dfasdfghadfhg

    04/23/2023, 8:56 AM
    The logo is so cool. But 100-1000$ for a cap seems weird, especially for an open source company. Building an app with supabase so do I need to win some sort of hackathon or smth?

    https://cdn.discordapp.com/attachments/1099619905109766204/1099619905269157948/image.png▾

  • Problem when fetching the data
    a

    alpha_

    04/23/2023, 9:00 AM
    I just unpaused one of my hobby project and was continuing working on the same but something weird happening when I fetch data from the db.
    n
    • 2
    • 19
  • Simple Auth changes event example
    p

    Philipp_Nut

    04/23/2023, 9:43 AM
    Hello I am currently trying Supabase. In the internet I am not able to find a simple solution. I want a page which listens to authstatechanges and when the user logs out there should automaticly showing the login page.
    j
    w
    • 3
    • 26
  • Example for RLS with IF EXISTS on another table ?
    y

    YokoWasis

    04/23/2023, 10:09 AM
    Basically I want to limit table, based on the role. e.g. check if the
    users.email=auth.email() AND users.role='admin'
    is exists on
    users
    table. If it exists allow the CRUD operation on
    thistable
    n
    g
    • 3
    • 7
  • Vercel generating a warn during deployment stating that modules not found : can't resolve encoding
    r

    Revaycolizer

    04/23/2023, 11:23 AM

    https://cdn.discordapp.com/attachments/1099656667127365672/1099656667253198899/module.png▾

    • 1
    • 1
  • helpers.js sending multiple requests when I login using Supabase Auth
    e

    emerql

    04/23/2023, 12:09 PM
    I'm using Next.js canary (13+) and Supabase auth (GitHub and email so far) and whenever i'm logged in, it starts sending multiple requests to Supabase Auth. How do I fix this?
    n
    • 2
    • 2
  • Custom domain and x.supabase.co domain coexistence
    g

    groi

    04/23/2023, 1:19 PM
    Hey, I recently went over the custom domains guide https://supabase.com/docs/guides/platform/custom-domains And saw that applying a new custom domain will break the Auth service on the old one. From my understanding, this will break my python client app (which used the x.supabase.co hardcoded) (unfortunately)
    Copy code
    self.rest_url: str = f"{supabase_url}/rest/v1"
            self.realtime_url: str = f"{supabase_url}/realtime/v1".replace("http", "ws")
            self.auth_url: str = f"{supabase_url}/auth/v1"
    Is there a way to make the original URL still available?
  • Are there supabase authentication sources with Next.js 13?
    o

    onurhan1337

    04/23/2023, 1:41 PM
    I'm trying to use supabase with Next.js 13 for the first time, but due to lack of resources and some problems I've had, things don't progress as I wish. I would be glad if you share your video or resource suggestions.
    a
    n
    • 3
    • 8
  • Cannot deploy edge function
    a

    Azimeel

    04/23/2023, 3:28 PM
    I cannot deploy my edge function, I think it's something to do with the import map but I'm at a loss how to fix it.
    Copy code
    Version 1.30.3 is already installed
    Bundling user-create
    Error: Error bundling function: exit status 1
    file:///src/import_map.json
    file:///src/index.ts
    file:///src/shared/models/result.ts
    file:///src/shared/models/user-create.ts
    file:///src/shared/models/user.ts
    file:///src/shared/supabase/supabase-client.ts
    error: Uncaught (in promise) Error: NotFound: The system cannot find the path specified. (os error 3)
          const ret = new Error(getStringFromWasm0(arg0, arg1));
                      ^
        at __wbg_new_8d2af00bc1e329ee (https://deno.land/x/eszip@v0.35.0/eszip_wasm.generated.js:513:19)
        at <anonymous> (https://deno.land/x/eszip@v0.35.0/eszip_wasm_bg.wasm:1:1559899)
        at <anonymous> (https://deno.land/x/eszip@v0.35.0/eszip_wasm_bg.wasm:1:1398157)
        at <anonymous> (https://deno.land/x/eszip@v0.35.0/eszip_wasm_bg.wasm:1:1895031)
        at __wbg_adapter_40 (https://deno.land/x/eszip@v0.35.0/eszip_wasm.generated.js:229:6)
        at real (https://deno.land/x/eszip@v0.35.0/eszip_wasm.generated.js:213:14)
    
    Try rerunning the command with --debug to troubleshoot the error.
    my import map:
    Copy code
    {
      "imports": {
        "/shared/": "./shared/",
        "@supabase/supabase-js": "https://esm.sh/@supabase/supabase-js@2.21.0",
        "postgres": "https://deno.land/x/postgres@v0.14.2/mod.ts",
        "std/server": "https://deno.land/std@0.168.0/http/server.ts",
        "zod": "https://deno.land/x/zod@v3.21.4/mod.ts"
      }
    }
    I'm using CLI
    1.50.11
    I'm on Windows.
  • Do function trigger errors prevent triggering action?
    b

    brassotron

    04/23/2023, 3:52 PM
    If I have a function triggered by an insert into table todos. If the function errors with a 500 for example, does this prevent the insert or will the insert happen regardless? Thanks!
    g
    • 2
    • 1
  • Typescript return type of a select operation
    t

    TimurKramar

    04/23/2023, 3:57 PM
    When running a select in ts like so:
    Copy code
    const {data} = supabase.from("ingredient_versions").select("*").eq('id',id)
    , typescript says that data is either the object representing the row in my database, an array of these objects, or null. But how can it ever by just the object. If I understand it correctly, unless i add
    .single()
    at the end, it should always be an array or null if any error occured. No? This makes it particularily difficult to send any fetch data down as props in typescript, as I never know whether it is an array, or directly the object. If there is some trick on how to send any fetched data (or better, how to define a component that accepts fetched data) without defining custom types and only using the autogenerated, I would love to hear it. In next.js app dir this would be perhaps the most useful feature. Thanks!
    g
    • 2
    • 1
  • issue when trying to build supabase locally
    z

    zaineb damak

    04/23/2023, 4:08 PM
    I am trying to build the project locally since I would like to contribute to it. I am following the developers.md guide on github. However I keep getting the same errors. Is there a way to solve it? Thanks in advance😊

    https://cdn.discordapp.com/attachments/1099728561578983567/1099728561721573436/Capture_decran_2023-04-23_170613.png▾

  • How to make an API request that requires a bearer token
    i

    insivika

    04/23/2023, 5:59 PM
    I'm looking to write a function that uses the HTTP extension in supabase and I found Jon Meyer's youtube tutorial on how to make a basic request however I'm unable to get it it work for a request that 1) requires a bearer token and 2) returns json. This is what my function looks like rn: DECLARE listings json; BEGIN SELECT content::json->>'value' INTO listings FROM http(( 'GET', 'https://api.mlsgrid.com/v2/Property, ARRAY[http_header('Authorization','Bearer 12345')], NULL, NULL )::http_request); RETURN listings; END; I attached a screen shot of what the output looks like (it shows pretty much notthing) The json return should something like this, I want to return the value key: { "@odata.context": "https://api.mlsgrid.com", "value": [ { "beds":4, "baths":2, "price":1000 } ] }

    https://cdn.discordapp.com/attachments/1099756388890189876/1099756389133467739/Screen_Shot_2023-04-23_at_12.56.24_PM.png▾

    j
    g
    • 3
    • 5
  • Use `.` in OR query
    y

    Yuu

    04/23/2023, 6:41 PM
    I'm trying to run the following query:
    Copy code
    ts
    const query = 'user@example.com'
    const user = await supabase.from('users_with_profiles').select('*')
         .or(`email=eq.${query},username=eq.${query}`)
         .single();
    It fails with error 'unexpected "=" expecting letter, digit, "-", "->>", "->" or delimiter (.)' '"failed to parse logic tree ((email=eq.user@example.com,username=eq.user@example.com))" (line 1, column 9)' Note that if i get the same error if the 2nd parameter doesn't contain a
    .
    '"failed to parse logic tree ((email=eq.user@example.com,username=eq.user123))" (line 1, column 9)' I'm not sure how to solve this
    g
    • 2
    • 14
  • how to I set timeout for OTP login link?
    e

    eforblue

    04/23/2023, 7:49 PM
    I am using supabase.auth.signInWithOtp to sign in users. Is there a way to set how long the signin link remain valid? What is the default expiration for the magic link?
    g
    • 2
    • 1
  • How should I Update a Table
    j

    justJosuke

    04/23/2023, 7:50 PM
    I am currently trying to add information to a table. This table holds the user information and data about their profile. Should I use the user's ID to update the table or should I use the access token? I also provided the SQL definition. create table public.users ( user_id uuid not null, username text null, status public.user_status null default 'OFFLINE'::user_status, user_address text null, email text null, phone text null, dob text null, gender text null, subscription_plan text null, profile_background text null, profile_picture text null, followers bigint null, following bigint null, media text null, clips text null, about_me text null, constraint users_pkey1 primary key (user_id), constraint users_user_address_key unique (user_address), constraint users_user_id_key unique (user_id) ) tablespace pg_default;
    g
    • 2
    • 1
  • Slow query retrieval
    b

    bboss

    04/23/2023, 8:27 PM
    Hello, I am working on a Flutter mobile app and was using Firebase but decided I wanted to check out Supabase as an alternative. My app is fairly simple right now, mostly some pages with lists of some short strings. With Supabase (free version), the app seems pretty slow to switch between different pages of lists. It seemed much speedier with Firebase. I put a timer around the async query to Supabase and the queries typically take 300-600ms to complete even when retrieving just a few rows. - Is this normal for the queries to take this long? - Is it because I'm using the free version, is the paid version faster? - Are there improvements I can make in the configuration? I have implemented some row level security policies to ensure users can only retrieve/edit their own items in the table. The basic query syntax I'm using is: supabase.from('list_items').select().match()
  • Can images uploaded to the Supabase storage be inserted into a table?
    x

    xdcx18

    04/23/2023, 8:35 PM
    So I am trying to make a simple grocery app where I can keep track of what items we need from a certain stores. I have two tables grocery store and grocerystoreitems, grocerystoreitems has a foriegn key that is associated with the primary id of the grocerystore. Each table also has a column for the the image url. Now my question is if I can build the logic to upload an image from my app, can I somehow add the url of the updated image to the table? like if I pass in the id of of the store or item? Could I trigger a function or something do it on the supabase side? Is this even possible?
1...189190191...230Latest