https://supabase.com/ logo
Join Discord
Powered by
# help-and-questions
  • supabase-provider error
    g

    Grimmjoww231

    05/14/2023, 6:52 PM
    dudes and dudetts i hope sunday coding is going better for you than for me. this error has been following me all day. and it was working yesterday without it being changed today. ┌ GET /favicon.ico 200 in 564ms │ └──── GET https://zluncbhyhpxonqhi../rest/v1/user_profile?select=*&user_i.. 200 in 179ms (cache: MISS) any ideas ?
    g
    s
    • 3
    • 18
  • How to connect to a backend through supabase? I have the details just dont know how to connect
    c

    codeine

    05/14/2023, 6:58 PM
    How to connect to a backend through supabase? I have the details just dont know how to connect
    • 1
    • 2
  • Only allow regestration after specific date or time?
    m

    Mondmarmelade

    05/14/2023, 7:24 PM
    What would be the best way to do that? Thanks in advance.
  • Getting specific table insert typed parameters
    k

    KiwiHour

    05/14/2023, 8:00 PM
    When doing
    supabase.from("table_name").insert()
    , you get intellisense like this. Which are the required key-types to successfully insert a new row. How can I get these key-types for my own
    addRow(row: KeyTypes)
    function?

    https://cdn.discordapp.com/attachments/1107396949038084118/1107396949709164574/image.png▾

  • Profile image fetched is not always the latest after user uploads
    l

    landfight

    05/14/2023, 8:19 PM
    **What i want to do**: After the user uploads an image, the new one is saved locally, but when they log out then log back in the app, they see the new image they uploaded **Whats happening right now**: After the user uploads an image, the new one is saved locally, but when they log out then log back in the app, they see the old image that they had Im not sure what changes to implement to enable this functionality, or does it have to do with something related to the supabase buckets or cdn?

    https://cdn.discordapp.com/attachments/1107401905866547230/1107401906013360279/code.png▾

    g
    • 2
    • 3
  • Migrate users to Firebase
    b

    baba-ipa

    05/14/2023, 8:53 PM
    How do I migrate Supabase users on various Providers (Google, Email, Facebook, GitHub) to Firebase? Is there a script or what are the steps to achieve this?
    v
    • 2
    • 2
  • Running supabase queries. Server-side vs client-side
    k

    KiwiHour

    05/14/2023, 8:55 PM
    If I wanted to insert a new row after a user fills in some information. Is there any downside to using the server side or client side supabase client I'm using sveltekit, so I'm wondering if using form actions or just plain js functions is better Or if there's no difference at all
  • is there a way to extract text from a pdf using edge functions? how did you do it?
    l

    lake_mattiato

    05/14/2023, 9:02 PM
    is it better to send a base64 in the request body or fetch the pdf from supabase storage?
  • Need help with RLS
    v

    ven

    05/14/2023, 10:28 PM
    I have two policies on a public.contact_me table. first policy enables anon users to insert their data into the table. this works fine from the browser. the second policy (see attached) is to allow authenticated users CRUD on the table but returns an empty array for getOne, getAll (havent tried update/delete yet). Can a DB guru help? thanks

    https://cdn.discordapp.com/attachments/1107434277165084732/1107434277332865094/enable_all_for_authenticated_users_is_returning_empty_array.png▾

    g
    v
    • 3
    • 59
  • Typing on joins issue
    m

    McLean 25

    05/14/2023, 10:47 PM
    It seems like every join you do with Supabase JS it doesn't know if the item is a single instance, and array, or null. Shouldn't it know that I have a one-many relationship, therefore if should be an array always? For example, this is the type for the following query I'm giving:
    Copy code
    ts
    const { data: fullList } = await supabaseClient
        .from("lists")
        .select("*, items:list_items(*)")
        .eq("id", listRankSessionId)
        .single();
    Copy code
    ts
    const fullList: {
        created_at: string;
        id: string;
        page: string;
        title: string | null;
        updated_at: string;
        items: {
            created_at: string;
            description: string | null;
            id: string;
            is_archived: boolean;
            isDone: boolean;
            list: string | null;
            position: number;
            title: string;
            updated_at: string;
        } | {
            created_at: string;
            description: string | null;
            id: string;
            is_archived: boolean;
            isDone: boolean;
            list: string | null;
            position: number;
            title: string;
            updated_at: string;
        }[] | null;
    } | null
    • 1
    • 2
  • problems with auth
    l

    Lyingcap

    05/15/2023, 12:40 AM
    Hello guys I'm new to this world of supabase and I'm having problems with the tutorial offered in the site, you can see the link here: https://supabase.com/docs/guides/auth/auth-helpers/nextjs-server-components. In the part of creating a supabase-provider.tsx (using ts), its given that beyond wrapping the {children} components in the , there is anoter component wrapped inside of it, the . But where do i import this from? It seems that there isnt imported using '@supabase/supabase-js'. Do you guys know where do I get ir from?
    g
    a
    +2
    • 5
    • 12
  • Korean channel?
    u

    <hmmhmmhm/>

    05/15/2023, 12:56 AM
    Can I request to create other channels besides #982210691517804594 ? We currently have a group of 45 developers in korea studying together, And I was wondering if we could get a korean channel as well.

    https://cdn.discordapp.com/attachments/1107471635587551255/1107471636011171850/Fv5yxYyaEAAp1gj.png▾

    o
    • 2
    • 3
  • Is RLS necessary ?
    v

    Vince

    05/15/2023, 1:08 AM
    I made a crawler that pushes news article to my supabase database. There isn't any authentification involved, no users etc.. I was wondering, is RLS necessary in this case ? If so, would allowing all operation from a certain role be enough ? Thank you very much
    g
    • 2
    • 2
  • Is superbase having issues? 30 sec + fetch times
    g

    Gnarley_Farley

    05/15/2023, 3:49 AM
    I am experiencing difficulties with my application as the retrieval times exceed 30 seconds. Is there a problem with the Super Bass network on the website? When I access the tables, it also takes an equally long time for the data to be retrieved. Other websites are functioning properly, and my upload and download speeds appear to be satisfactory. I am currently located in the Pacific Fiji. Any information provided would be greatly appreciated.
    a
    • 2
    • 1
  • is it better to use functions/triggers to store user profile data or use "user_metadata" ?
    a

    Actual Left Shark

    05/15/2023, 4:19 AM
    I have a user sign up with auth like this
    Copy code
    const signUp = async () => {
        const { data, error} = await supabase.auth.signUp({
          email:email,
          password:password,
          options: {
            data: {
              first_name: 'John',
             last_name: 'Doe',
              username: "john123,
            },
          },
        })
    and then can access this using
    useUser
    from auth-helpers-react. or is it better to do something like this
    Copy code
    const signUp = async () => {
        const { data, error} = await supabase.auth.signUp({
          email:email,
          password:password,
          
        })
        await supabase.from("profile").update({profile_name:"John123"}).eq("id",data.user.id)
      }
    and then fetch the data from the "profile" table with another call? I also have the second option using triggers/functions within supabase to keep the private auth table connected with the public facing "profile" table. I am planning to keep a mixture of things in there like profile_name, ratings, etc.. but also including things like stripe UID's and their shipping address. Is option 1 more secure because it is not a public facing table? My assumption is that I would need to combine both - the more secure data (stripe, address, etc..) in the more private 'useUser' approach. But for public facing things (username, rating, posts, etc..) it would need to be in the second option in a public facing table to allow other users (not just the one authenticated) to access the information. Does this seem correct logic? is this secure? Using CRA -- thanks!
    o
    • 2
    • 8
  • Remote function not found when using `.rpc()`
    x

    xa

    05/15/2023, 5:39 AM
    Locally, I can see my function under
    API Docs/Stored Procedures
    , but when I push the changes to the remote database using
    supabase db push
    , the function is missing. I have three functions and only one shows.

    https://cdn.discordapp.com/attachments/1107542769624428594/1107551809238749204/Screenshot_2023-05-15_at_2.14.29_PM.png▾

    • 1
    • 3
  • Performance difference webhooks/realtime
    k

    Kjell

    05/15/2023, 8:04 AM
    Hi, I currently have an app built on database changes using Supabase realtime; however, we would like to change to webhooks as we prefer to use HTTP messages. I was wondering whether there are any performance differences between supabase webhooks and supabase realtime. For example, do both alternatives fire for all changes? or can there be a fraction lost? Which one has a higher loss fraction? Are there any other differences to consider? Also for example, we noticed that the python realtime would have to restart frequently, how is this for the webhooks functionality? It would help a lot, thanks!
    o
    • 2
    • 4
  • Postgrest getting execution plan through HTTP
    j

    JTJTJTJT

    05/15/2023, 9:14 AM
    https://supabase.com/blog/postgrest-v10#getting-the-execution-plan-through-http I tried getting the execution plan through HTTP, however I am met with an error
    {"code":"PGRST107","details":null,"hint":null,"message":"None of these media types are available: application/vnd.pgrst.plan+text"}%
    Is there anyway else to check execution plan of postgrest api query ?
    g
    • 2
    • 2
  • alter sequence not working
    n

    Nxia618

    05/15/2023, 10:04 AM
    I’ve put a the following in a migration file and done a db push but it’s not resetting the sequence, values 2, 3, 4 etc generated
    Copy code
    sql
    ALTER SEQUENCE “public”.”procurement.orders_id_seq” RESTART WITH 7000;
    The name above matches that from pg_sequences, This is driving me mad and stopping me going onto paid tier for production
    • 1
    • 2
  • Not allowing anyone to delete a table
    c

    crypticBuddha

    05/15/2023, 10:15 AM
    I have written a rls whose photo I have attached with this post. I don't want anyone to delete the table. but it is not working. Thanks in advance

    https://cdn.discordapp.com/attachments/1107612226774388786/1107612226929557575/image.png▾

    n
    • 2
    • 2
  • Next.js Middleware OAuth Issue
    p

    perl

    05/15/2023, 10:30 AM
    Hey everyone, I am having an issue where when a user signs in with Google OAuth, once the redirect happens, it gets caught by the route guarding in my middleware and redirects back to the sign-up page. Here is my middleware:
    Copy code
    export const revalidate = 0
    
    export async function middleware(req: NextRequest) {
      console.log("middleware ran")
      const res = NextResponse.next()
      const supabase = createMiddlewareSupabaseClient<Database>({ req, res })
      const {
        data: { session },
      } = await supabase.auth.getSession()
    
      if (!session && req.nextUrl.pathname !== "/sign-up") {
        const url = new URL(req.url)
        url.pathname = "/sign-up"
        return NextResponse.redirect(url)
      }
      return res
    }
    And my google sign in function
    Copy code
    async function signInWIthGoogle() {
        const { data, error } = await supabase.auth.signInWithOAuth({
          provider: "google",
          options: {
            redirectTo:
              "https://usuals-consumer-web-git-app-router-storialp.vercel.app",
          },
        })
      }
    The issue from what I can gather fro the network tab is that cookies are set (or at least can be read) only after middleware has already redirected to the sign-up page. When I look at the network tab, google tries redirecting to the specified route only to get denied (300 status code) by middleware. However, user only sees to be requested after the redirect is complete, as if js is executing the redirect without having first requested the session. It imght be worth noting that as recommended by the docs, in my supabase provider I am refreshing the page onAuthStateChange. Also worth noting that if I manually change the url back to the homepage, middleware does detect the session and doesn't redirect me. Have any of you dealt with this before or have any ideas? Would appreciate any help!!
    s
    j
    • 3
    • 4
  • rpc question
    p

    phil

    05/15/2023, 11:27 AM
    how did John make that "upvotes" rpc functionin this video @14minutes? any material/direction into creating it?

    https://www.youtube.com/watch?v=Qc8_y9irMP4&ab_channel=Supabase▾

    just kind of recreated the same functionality like this, is that okay or am i setting myself up for some problem later down the line?

    https://cdn.discordapp.com/attachments/1107630297572454461/1107634717982982215/Screenshot_2023-05-15_at_3.43.40_PM.png▾

    p
    • 2
    • 2
  • auth-helpers-nextjs throwing errors suddenly - next v13.1.6
    c

    CamBlackwood

    05/15/2023, 11:50 AM
    I'm running auth helpers in my nextjs app and am getting this error when I try and navigate to any page that requires authentication: Failed to parse cookie string: [Error: The edge runtime does not support Node.js 'buffer' module. From researching online, it seems to be something to do with the createMiddlewareSupabaseClient function. I'm using auth-helpers-nextjs version 0.5.9
    o
    s
    • 3
    • 8
  • Edge function `import_map` not found
    b

    bombillazo

    05/15/2023, 1:02 PM
    Hello, we are deploying an edge function suing an
    import_map.json
    file in the functions directory inside the supabase dir. However, when we run the deployed function, we get the following message:
    Copy code
    sh
    module not found: file:///src/import_map.json
    How can we ensure our import-map.json is visible to the edge function?

    https://cdn.discordapp.com/attachments/1107654159307645000/1107654159685144617/image.png▾

    o
    x
    +8
    • 11
    • 68
  • Java CORBA Project Wordy Game
    c

    Conflicted Cortana

    05/15/2023, 1:09 PM
    so i'm stuck on the login page so basically the authentication i still not good on the users to login module that's why it won't push through the game itself please someone help me fix it :< here's the error and the class https://sourceb.in/s7xwNYlwQK

    https://cdn.discordapp.com/attachments/1107655887465758852/1107655888510132295/IMG_4093.mov▾

    https://cdn.discordapp.com/attachments/1107655887465758852/1107655889248329758/project.png▾

    o
    g
    • 3
    • 25
  • Hello-world deploy getting 502: Bad Gateway (BOOT_FAILURE)
    x

    Xquick

    05/15/2023, 1:09 PM
    I deployed default hello-world function and when CURLing the endpoint I get 502 with following in the function log:
    Copy code
    Event message
    module not found: file:///src/import_map.json
    Any idea please? I tried deploying with --importMap flag as well but no luck. Locally function works just fine. Thank you for any help 🙏
    • 1
    • 1
  • Supabase Server-Side Auth with Expo
    s

    sb

    05/15/2023, 2:01 PM
    Hey folks, Is there a way to use something equivalent to createBrowserSupabaseClient() with Next.js and Expo, so that when a request is made to the Next.js server, cookies are automatically sent in the headers and the session can be accessed on the server with supabaseServerClient?
  • New migrations not being applied to local machines despite restarting containers
    v

    ven

    05/15/2023, 2:23 PM
    Hello - Yesterday I dropped an enum in my DB and successfully pushed the change to remote/prod using github actions. This morning I found out that my team pulled the latest repo, restarted their containers using supabase start/stop but the migration didnt get applied to the db. We can see the migration in the folder but it is not getting applied to the local db. we all have the latest cli (1.60). why is the migration not getting implemented on local machines?
    b
    • 2
    • 3
  • edge functions 401 status
    f

    formigueiro

    05/15/2023, 2:33 PM
    Ive created a simple edge function
    Copy code
    js
    import { serve } from "https://deno.land/std@0.168.0/http/server.ts"
    
    console.log("Hello from Functions!")
    
    serve(async (req) => {
      const { name, record } = await req.json()
      const data = {
        message: `Hello ${name}!`,
        record
      }
    
      return new Response(
        JSON.stringify(data),
        { headers: { "Content-Type": "application/json" } },
      )
    })
    and im using this header, but im gertting 401 (Invalid JWT), but im copy equal

    https://cdn.discordapp.com/attachments/1107677220660588615/1107677221033885706/image.png▾

  • Can't create Bucket
    h

    Ho3einvb

    05/15/2023, 2:42 PM
    error => An invalid response was received from the upstream server (Supabase self hosting)
1...214215216...230Latest