https://supabase.com/ logo
Join Discord
Powered by
# help-and-questions
  • Can't make column unique
    t

    Tater Of Tots

    12/31/2022, 6:27 PM
    I have a table with like 1000 rows. The one column is nullable and not unique. I want to make it unique and not nullable. Every time I try to change it I get an "An error has occurred: Failed to fetch". I have run scripts to try and remove any duplicate rows and I have run scripts to remove any NULL rows. Despite this it will not let me make this change. I'm not really a back end guy so hopefully this is an obvious easy fix.
  • How is supabase supposed to be used in browser if you don't want to expose the env variables?
    a

    Askar

    12/31/2022, 7:15 PM
    If we create the client in NextJS, we have to expose the variables such as NEXT_PUBLIC... in order to create the client with the servicekey. So what am I misunderstanding on how to securely use Supabase in browsers?
    g
    • 2
    • 6
  • TypeError _utils_supabase__WEBPACK_IMPORTED_MODULE_2__.supabase.auth.user is not a function
    m

    MJD

    12/31/2022, 7:26 PM
    I followed the tutorial on https://egghead.io/courses/build-a-saas-product-with-next-js-supabase-and-stripe-61f2bc20 to build an SaaS template with NextJS, supabase and stripe. When running the code and trying to access
    localhost:3000
    I see this error:
    TypeError: _utils_supabase__WEBPACK_IMPORTED_MODULE_2__.supabase.auth.user is not a function
    Any guidance on getting past this error would be appreciated.
    g
    • 2
    • 8
  • edge function cron job
    z

    zeyad

    12/31/2022, 7:57 PM
    is it possible to create like a postgres cron job that calls an edge function?
    g
    • 2
    • 2
  • Setting up custom domains.
    e

    Elon Salfati

    12/31/2022, 8:27 PM
    Hi there 👋 I'm trying to set up custom domains (on the paid hosted version). - I added the required CNAME domain. - I went back to the dashboard and tried to add the domain and I keep getting this
    failed to create custom hostname
    error. Any idea what is missing? Or where I can get more information about the error? I ran the CLI in debug mode, which wasn't great as well
    g
    • 2
    • 1
  • can you use nextauth + auth-helpers-nextjs??
    c

    Clay

    12/31/2022, 8:47 PM
    Just wondering - are these two libraries compatible? Will auth-helper pick up the sessions used by nextauth?
    s
    • 2
    • 1
  • discord oauth guilds scope
    m

    maniak

    12/31/2022, 8:55 PM
    Hello! Is in supabase any option to get user server list using
    guilds
    scope? Happy new year to everyone! 🎆
    m
    k
    • 3
    • 6
  • I just created my first database but even the simplest query in the SQL Editor fails,
    g

    Gruven

    12/31/2022, 9:32 PM
    create table users { id bigint primary key }; Failed to validate sql query: syntax error at or near "{"
    g
    • 2
    • 1
  • How can I use social login via the CLI?
    m

    maxc

    12/31/2022, 10:24 PM
    I'd like to set up social login locally as a I do development however I don't see any option to enable these from the studio. I'm using the latest supabase cli. How can this be accomplished?
    g
    s
    • 3
    • 4
  • Recommend a setup for a multipayer puzzle game
    f

    Florian

    12/31/2022, 11:03 PM
    I want to build a simple round-based multiplayer puzzle game in a web browser. Can someone recommend a combination of Supabase features to use to realize that? Both players are trying to find the same solution to the puzzle. Since I use NextJS's serverless functions, I can't store the game solution on the server. Should I store the solution in a table in Supabase? Also, how do you create game lobbies and limit them to a certain number of players? I've already set up Supbase auth and looked into channels, but channels are not enough.
  • Supabase Auth with Next JS 13 (client-side)
    b

    bill92

    12/31/2022, 11:33 PM
    Are there any guides on how to use supabase auth with Next JS 13 with the new app folder (client side only)? I’ve seen an example with server side components but that’s not what I’m looking as I’ll be building an app that will only use client side components. Thanks
    g
    s
    +2
    • 5
    • 9
  • Join table query with filter
    b

    Brian

    01/01/2023, 12:59 AM
    Is it possible to query a many-to-many relationship (join table) while filtering that join table? Example: A
    company
    table and
    contact
    table are joined by a
    company_has_contact
    join table. There is a field on
    company_has_contact
    called
    relationship_type
    which houses values like
    employee
    ,
    owner
    customer
    etc. How might I query a company and join in related contacts that are of
    relationship_type
    owner
    ?
    Copy code
    supabase
        .from('company')
        .select(`id, name, contacts(id,first_name,last_name)`)
        .eq('id', id)
    s
    • 2
    • 1
  • Issue with database slow or crashing
    j

    jarryd

    01/01/2023, 3:54 AM
    I keep running into an issue with my database retuning 504 errors when there's a large volume of inserts into the database via API. It' stalls everything, I can access the logs but most database related sections such as table editor/sql editor don't load and even the admin/usage tab returns an error. After restarting the project those same inserts run perfect and super quick, so doesn't seem to be a major issue with the functions being used otherwise I'd assume the issue would happen even after restarting the project. I have regular chunks of inserts each day (they're not huge only 6k-7k but over a 5-10mins)
    s
    • 2
    • 2
  • Get supabase server time.now() on the front end?
    c

    Crownie

    01/01/2023, 5:02 AM
    is it possible?
    • 1
    • 1
  • Trigger User Deletion Not Working
    a

    anggoran

    01/01/2023, 9:55 AM
    Copy code
    CREATE OR REPLACE TRIGGER ban_automation
    AFTER DELETE ON auth.users
    FOR EACH ROW EXECUTE PROCEDURE
    public.ban_automation();
    
    CREATE OR REPLACE FUNCTION public.ban_automation()
    RETURNS trigger
    LANGUAGE plpgsql
    SECURITY DEFINER SET search_path = public, auth, extensions
    AS $$
      BEGIN
        DELETE FROM public.members
        WHERE members.id = new.id;
        RETURN new;
      END;
    $$;
    g
    • 2
    • 7
  • This project does not exist
    d

    Deleted User

    01/01/2023, 10:53 AM
    Since this morning, I am greeted with a "This project does not exist" error after login with the correct account. All of my projects from the disappeared. API request to invoke functions are executing fine, however. It's seriously impacting me... Somebody has an idea why this is the case?
    j
    • 2
    • 1
  • Is any change to debug RLS?
    u

    (FOX)

    01/01/2023, 11:19 AM
    Hi there is there any change to debug RLS ? I have :
    (get_my_claim('userrole'::text) = '"admin"'::jsonb)
    this type RLS. I can not know what happening inside how I can manage this type errors? btw claims docs here : https://github.com/supabase-community/supabase-custom-claims
  • Dynamic Email Template
    f

    FeliX

    01/01/2023, 11:54 AM
    Is it possible to have a dynamic Email template for Magic Link authentification? For example depending on the redirection url or have the template specified on the client side directly. I want this because I would like to send the user a login link which automatically triggers another action and the user should be notified in the email to avoid confusion.
  • Supabase hangs on setting up project, after reviving
    c

    Crenshinibon

    01/01/2023, 12:46 PM
    After reviving my Supabase project the project hangs for days in "setting up project" ...
    • 1
    • 1
  • Getting database error trying to sign up new user after signing up 2 users
    g

    garyaustin

    01/01/2023, 3:21 PM
    This usually ends up being an issue with an insert trigger function you’ve added to auth.users table.
  • edge functions logs
    g

    Guy Rozen

    01/01/2023, 1:14 PM
    For some odd reason I've noticed that the edge functions' logs are only working once, and following calls would then no longer print the logs in the dashboard. I assume it has something to do with the CDN caching. Is there a way to still follow up the associated edge functions' logs after the initial cold start?
  • How to set service role key in auth helpers
    i

    izurugi

    01/01/2023, 1:32 PM
    Hello how to set service_role key in ssr using nextjs auth helpers. From client we can set the supabase service_role key like this https://supabase.com/docs/reference/javascript/admin-api. But from auth helpers we can only get the
    createServerSupabaseClient
    like this and seems like there is not option to pass a key using that function.
    j
    s
    • 3
    • 2
  • How to customize Auth-UI?
    d

    D.Nova

    01/01/2023, 1:56 PM
    I just wondering is there a way to customize the social layout & round corner easily like this in the picture? (I knew those are css property but i'm really bad at changing css so...) Glad if there is a way. Thanks in advance ❤️
  • Using Next and React Auth helpers, SignOut() not working?
    s

    sergi087

    01/01/2023, 3:22 PM
    Hello, I have been trying to use the "useUser()" function and context suggested here: https://supabase.com/docs/guides/auth/auth-helpers/nextjs This worked fine with the AuthUI Component, so I could sign in and I could retrieve my user using "useUser()". I have a "SignOut" component that looks like this:
    Copy code
    export default async function SignOut() {
    
        const handleSignOut = async () => {
            const { error } = await supabase.auth.signOut();
    
            if (error) {
                toast.error(error);
            } else {
                // setUser(null);
                router.push('/');
            }
        };
    
        return (
            <Button variant="primary" type="button" onClick={handleSignOut}>
                Sign Out
            </Button>
        );
    }
    This does trigger a "SIGN_OUT" event if I listen to "supabase.auth.onAuthStateChange" but my UI does not change, the user is still logged in and nothing happens, how am I supposed to log the user out?
    j
    a
    +4
    • 7
    • 22
  • Cache lookup failed for type
    t

    Teodor Todorov

    01/01/2023, 3:54 PM
    Hey 👋 I just ran my DB creation script (which drops all of my tables, types, triggers, functions,..) and recreate them but I’m facing an issue where I get an error saying « Cache lookup failed for type 31624 » Any idea how I could solve that ? Found by googling a bit that it has to to with previous types being cached and still being referenced or something like that but I don’t know how I should solve that.
    • 1
    • 1
  • Storage upload() function returning 404 error
    s

    Skosh

    01/01/2023, 4:21 PM
    I'm trying to upload files with the service role key, since I cannot get file uploading to work with the RLS templates for the life of me (I just keep getting unauthorized, even if i allow everyone to do everything) This is my NextJS API Endpoint:
    Copy code
    typescript
    
    // Handler
    const handler = nextConnect({})
      .use(parseMultipartForm)
      .post(async (req, res) => {
            console.log("FILES ");        console.log(req.files.file);
            // @ts-ignore
            const { data, error } = await supabaseService.storage.from('images').upload('somimg.jpg', req.files.file);
          // error here
      });
    
    export default handler;
    This gives the following error:
    Copy code
    json
    {
      statusCode: '404',
      error: 'Not Found',
      message: 'The parent resource is not found'
    }
    I'm completely at a loss here... Thank you in advance!
    g
    h
    • 3
    • 24
  • Getting database error trying to sign up new user after signing up 2 users
    r

    Revaycolizer

    01/01/2023, 5:43 PM
    I had sign up using service working but after some few days I keep having this error whenever I try to perform a user sign up 'Database error saving new user ' Below is the code: const {email, password} = await supabase.auth.signUp({ email:email.value, password :password.value )}
    g
    • 2
    • 25
  • Azure auth returns to root
    k

    Kraktoos

    01/01/2023, 5:58 PM
    Using Nextjs and supabase, everytime I login from '/join' using the azure auth, it works but returns to '/'. How can I stop it from doing that? Here is the function I use to sign in with azure
    Copy code
    js
    const signInWithAzure = async () => {
        console.log("signing in with azure...")
        const { data, error } = await supabase.auth.signInWithOAuth({
          provider: 'azure',
        })
        if (error) alert(error.message)
      }
    g
    • 2
    • 4
  • I have an RPC function to insert data into my table but I can't figure out how to setup RLS.
    a

    adamnemecek

    01/01/2023, 6:51 PM
    Anon should be able to call the function (insert data). I tried
    GRANT EXECUTE ON FUNCTION some_function TO anon;
    g
    • 2
    • 2
  • Edge function session is null
    d

    daniromo

    01/01/2023, 8:29 PM
    I'm trying to retrieve the session like this: const supabaseClient = createClient( Deno.env.get('SUPABASE_URL') ?? '', Deno.env.get('SUPABASE_ANON_KEY') ?? '', { global: { headers: { Authorization: req.headers.get('Authorization')! } } } ) const { data } = await supabaseClient.auth.getSession() console.log(data) and both data and error objects from that function return null, is there anything else that should be done in order to get the session? I based my function from this https://github.com/supabase/supabase/blob/master/examples/edge-functions/supabase/functions/select-from-table-with-auth-rls/index.ts I'd really appreciate any help 🙌
    g
    g
    m
    • 4
    • 19
1...848586...230Latest