https://supabase.com/ logo
Join Discord
Powered by
# help-and-questions
  • Angular File Manger
    g

    Guille

    02/28/2023, 11:34 AM
    Hey, I need an Angular component to display files from a Supabase store bucket, any recommendations?
    j
    • 2
    • 3
  • Getting 502 error codes on auth
    h

    Heyl

    02/28/2023, 11:37 AM
    Every auth request returns 502 code, DB seems to be working fine (checked calling manually) It seems that it started like an hour ago. Every request returns an error
    Copy code
    json
    {
       "message": "An invalid response was received from the upstream server"
    }
    EDIT: I did manual restart of project but did not fix them problem
    g
    k
    +5
    • 8
    • 36
  • What policies do I need to allow any postgres function to manipulate a table?
    j

    jfbn

    02/28/2023, 12:01 PM
    I make very few requests on my own -- those that I do make, will start triggers that run postgres functions for the remainder of my necessary backend functionality. What kind of policy do I need to enable, to allow any table manipulations that are done from "postgres" itself? Or is it from Supabase?
    • 1
    • 1
  • Self-hosted vs Online solution
    d

    DenNis

    02/28/2023, 12:28 PM
    What are the differences between the self-hosted version and the online version of Supabase?
    s
    • 2
    • 1
  • Trying to set type of slug from object, getting cannot convert error
    v

    Vimes

    02/28/2023, 12:28 PM
    Trying to set the type of a slug I get from supabase, but through countless attempts and copy pastes from stackoverflow I'm still getting the same error. Not sure exactly how I'm suppose to say "this is a string or null" Getting error Property 'slug' does not exist on type '{ slug: unknown; } | { slug: unknown; }[]'. Property 'slug' does not exist on type '{ slug: unknown; }[]'
    Copy code
    js
    type Audit = {
        content: {
          descendants: { items: ContentProps[] };
          id: string;
          level: number;
          name: string;
        };
      };
      type Organization = {
        org: {
          organization: {
            slug: string | null | undefined;
          };
        };
      };
    
    
      const audit = (await getAudit(
        (`/granskninger/${org?.organization?.slug as Organization}`) + <- ERROR IS HERE
          `/${ctx.query.slug as string}`
      )) as Audit;
    j
    • 2
    • 4
  • Supabase Joining
    k

    Katoka

    02/28/2023, 1:26 PM
    Since I have found no way to join tables without identical column names or foreign keys, I've written this code. Does this make any sense? Can it work?
    g
    f
    j
    • 4
    • 9
  • error
    l

    LUCIFER

    02/28/2023, 1:49 PM
    hello i wanted help on a issue regarding a thing that a schema i used needed role supa base admin but even if i try to change scema it needs a role so if osmeone acan help and tell what the default role is for a creater in supabase
    g
    • 2
    • 1
  • Running local with CLI, want to set the project to what's hosted and get rid of all the commits
    f

    FluffySmiles

    02/28/2023, 3:28 PM
    To be clear. I now have quite the collection of diff scripts and am happy with where it all is now, but every attempt I've made to pull what's hosted back as the de-facto starting point fails horribly. Does anyone have any tips on resetting the state of a project and pulling what's hosted back as a new baseline/starting point?
    s
    • 2
    • 8
  • Public GA roadmap ?
    s

    Shraow

    02/28/2023, 3:37 PM
    Hello ! I’m currently looking for an alternative to firebase and supabase seems to be the go to solution. My concern is that the project is only in public beta. Do you have a roadmap for the Public GA ? Or a approximation of the release date ? 6 months / 1 year / 2 years ? Thanks !
    g
    • 2
    • 6
  • Cannot find module '@supabase/supabase-js'
    d

    DikiyKazah

    02/28/2023, 3:52 PM
    Did a clone from my github, cant start it now(
    • 1
    • 1
  • Reset password
    b

    Bamsespartymix

    02/28/2023, 4:30 PM
    Hi, I'm a webdeveloper student who is trying to create a reset password function using next.js and supabase. Right now the user gets an email and is redirected to my site where I just have a form for a new password and trying to get the logic to work. This is the code i've written:
    Copy code
    import React, { useEffect, useState } from "react";
    import { supabase } from "../../utils/supabaseClient";
    
    function ResetPassword() {
      const [password, setPassword] = useState("");
      const [token, setToken] = useState();
    
      useEffect(() => {
        const params = new URLSearchParams(window.location.search);
        setToken(params.get("token"));
      }, []);
    
      const handleSubmit = async (e) => {
        e.preventDefault();
    
        if (token) {
          const { error } = await supabase.auth.updateUser(token, {
            password: password,
          });
          if (error) {
            console.log("Something went wrong");
            console.log(error);
          } else if (!error) {
            console.log("password has changed");
          }
        }
      };
    
      return (
        <div>
          <form onSubmit={(e) => handleSubmit(e)}>
            <input
              type="password"
              required
              value={password}
              placeholder="Please enter your Password"
              onChange={(e) => setPassword(e.target.value)}
            />
    
            <button type="submit">Submit</button>
          </form>
        </div>
      );
    }
    export default ResetPassword;
    I get this error "AuthSessionMissingError: Auth session missing!". Hope someone can help me! 🙂
    g
    s
    • 3
    • 5
  • Egress spike
    g

    Gentlemonke

    02/28/2023, 4:32 PM
    Hi, I have recently noticed my egress has spiked from 1.3TB and I have no idea why - we have had no increase in usage so it's likely something I've broken but I don't know where to start looking for it. Are there any logs/queries I can look at to find out what is causing this?
    g
    • 2
    • 1
  • Possible to link socials without email w/o signIn?
    t

    TradeUpCards

    02/28/2023, 4:59 PM
    Looking for a way to link social accounts using OAuth but without requiring email since some Twitter accounts don't have one linked. I also am handling user accounts in my public.users table and their wallet is their unique identifier. I just want to link socials, not use them as a sign-in. Looking at the documentation and methods available I'm not sure this is possible with Supabase methods. I've been told to use passport-twitter instead, but figured I'd come ask here first. Is there documenation or examples for the use of queryParams and scopes? I'm wondering if those provide options for what I'm looking for, or is there another method that can do this in supabase?
    g
    • 2
    • 7
  • How to ignore UUID type when using it with .or()?
    z

    zetiks

    02/28/2023, 5:08 PM
    Hello! So I am passing a param in the URL that is either the user's nickname or his UUID. So it can be either
    UUID
    or
    text
    . Then, based on that I would like to use the
    or()
    method in JavaScript to select the row if it matches either UUID or the `username`:
    Copy code
    js
    .or(`username.eq.${params.username},id.eq.${params.username}`)
    The above works if I pass the UUID as
    params.username
    , but fails when I pass a text, because it expects the
    id
    column to be UUID. Is there a way to tell supabase to just keep it calm and try get me the results even if the second argument in
    or
    statement is wrong type? I could, in theory, check if the param matches the UUID format with regexp, but am wondering if there might be a simpler way?
    g
    • 2
    • 7
  • Downloading file from public bucket
    j

    jumeh

    02/28/2023, 5:47 PM
    Hi! I'm trying to figure it out how to download a file from a public bucket. Here is what we get from the doc: "Downloads a file from a private bucket. For public buckets, make a request to the URL returned from getPublicUrl instead." What do they mean by make a request to the URL returned from getPublicUrl instead? supabase .storage .from('avatars') .download('folder/avatar1.png') is the only method to download from the bucket right?
    g
    • 2
    • 2
  • filter the select
    t

    theravenstone

    02/28/2023, 6:38 PM
    hey, i want to filter my table. there is a column with "end_date". this column can be NULL but if it is set, filter from results when end_date is is the past. so that the entries are not shown when enddate is set and is in the past how to do? ty everyone
    g
    • 2
    • 3
  • Invoke a streaming function via supabase js
    r

    rbl

    02/28/2023, 7:30 PM
    This video could not come at a more perfect time:

    https://www.youtube.com/watch?v=9N66JBRLNYU▾

    How do we invoke this via the js client? Is there any support there or do we have to implement our own supabase function call with an event source?
  • Social login and unique value in table
    ř

    Řambo

    02/28/2023, 7:52 PM
    So i have a function and trigger setup so when a user logs in with social provider it will save their
    full_name
    in
    public.profiles
    table under
    username
    In the
    public.profiles
    table
    username
    column is set to unique. What happens if two users login with social provider and have the same name. Will the trigger throw an error or something?
    g
    • 2
    • 20
  • OAuth providers settings in self-hosted Dashboard
    s

    squallsama

    02/28/2023, 8:44 PM
    Is it possible to access oauth providers settings in a self-hosted docker dashboard ?
    g
    • 2
    • 3
  • Best Practice for migrations schema
    f

    fidelio

    02/28/2023, 8:49 PM
    Hi everyone. I followed the guide to automatically update the schema through github actions. I'm wondering if it is a best practice to have the
    supabase_migrations
    schema be a public / unprotected schema?
    g
    • 2
    • 3
  • Returning closest matching results in database based on user search
    m

    maglev

    02/28/2023, 9:16 PM
    Hi, for the following keyword search: "Software Engineer" I would like to return the closes matching result from a fixed set of options on a database table such as [Manager, Engineer, Designer, Accountant] would return "Engineer" [Manager, Engineer, Software Developer, Designer, Accountant] would return "Software Developer" Is this possible using the existing features of supabase (maybe with a string-similarity library) or would I need to use a vector database with semantic search functionality? Thanks.
    g
    • 2
    • 3
  • Sign in Provider not working after hosting web app
    r

    Revaycolizer

    02/28/2023, 9:38 PM
    I implemented sign in with Google ang github both were working fine in development mode but after hosting both are not working
    g
    • 2
    • 9
  • How to add team mates to my project?
    r

    rafael

    02/28/2023, 10:33 PM
    Hey guys, I have a friend collaborating with me in my project, and I would like to give him access to my supabase account. There is any way to add him as a team member using a free account? Thanks
    g
    • 2
    • 3
  • Filtering on jsonb fields with string keys via the javascript client
    i

    imagio

    02/28/2023, 10:38 PM
    I'm trying to query for data that I've imported from firebase. To do this I need to query on some json columns that contain keys that are arbitrary strings. Using the javascript client I've tried for example:
    Copy code
    ts
    connection.from("myTable").select("*").eq("members->NTfzpLMrWFZPYjSGCaGdwCIh5Ti2->userId", "NTfzpLMrWFZPYjSGCaGdwCIh5Ti2")
    However this fails with
    {"code": "22P02", "details": "Token \"NTfzpLMrWFZPYjSGCaGdwCIh5Ti2\" is invalid.", "hint": null, "message": "invalid input syntax for type json"
    (trying to put quotes around it doesn't change the outcome either) I can execute this query in any sql editor in a number of ways, such as
    Copy code
    sql
    select * from public."myTable" t
    -- where t.members -> 'NTfzpLMrWFZPYjSGCaGdwCIh5Ti2' ->> 'userId' = 'NTfzpLMrWFZPYjSGCaGdwCIh5Ti2'
    -- where t.members @> '{"NTfzpLMrWFZPYjSGCaGdwCIh5Ti2": {"userId": "NTfzpLMrWFZPYjSGCaGdwCIh5Ti2"}}'
    where t.members @? '$.NTfzpLMrWFZPYjSGCaGdwCIh5Ti2.userId'
    Any of those three techniques works with plain SQL. None of them seem possible with the JS SDK. How can I query nested fields with arbitrary string keys from the JS SDK?
    g
    • 2
    • 12
  • Supabase Auth trouble mixing client and server components in Next.js 13
    f

    fidelio

    02/28/2023, 11:38 PM
    I followed the auth guide (linked below) and am having trouble pulling data using the
    createServerClient
    function for server components in Next.js 13. Here's the server component code I'm using
    Copy code
    import "server-only";
    
    import { createServerClient } from "@/lib/supabase-server";
    
    // do not cache this page
    export const revalidate = 0;
    
    export default async function Page() {
      const supabase = createServerClient();
      const { data, error, status } = await supabase
        .from("profiles")
        .select("*")
        .single();
      if (error) {
        console.error(error);
        console.error(status);
      }
      return (
            <p>Welcome, {data?.id}!</p>
      );
    }
    I get the following error:
    Copy code
    {
      message: 'FetchError: fetch failed',
      details: '',
      hint: '',
      code: ''
    }
    0
    The strange thing is that I'm able to properly query the database from client components ("use client")
    Copy code
    "use client";
    
    import { useRouter } from "next/navigation";
    
    import { useSupabase } from "@/components/supabase-provider";
    import { Auth } from "@supabase/auth-ui-react";
    import { ThemeSupa } from "@supabase/auth-ui-shared";
    import { useEffect, useState } from "react";
    
    export default function Login() {
      const { supabase, session } = useSupabase();
      const [userId, setUserId] = useState<string | null>();
      const router = useRouter();
    
      useEffect(() => {
        if (session) {
          router.push("/");
        }
      }, [session, router]);
    
      return session ? (
        <>
          <h1>Logged in as {userId}</h1>
        </>
      ) : (
        <>
          <h1 className="mb-5 font-title text-2xl">Sign In</h1>
          <Auth supabaseClient={supabase} appearance={{ theme: ThemeSupa }} />
        </>
      );
    }
    In this case, I'm able to see the
    Logged in as {userId}
    show with the correct id from the profiles table. Any help would be appreciated. Thanks! https://supabase.com/docs/guides/auth/auth-helpers/nextjs-server-components
    • 1
    • 1
  • Edge function deploy error: BasicBlock requested for unrecognized address
    a

    Aergis

    02/28/2023, 11:45 PM
    I am trying to deploy a function that I already have working on another project, however I keep getting this error I can't track down.
    Copy code
    Version 1.30.3 is already installed
    Bundling results
    Error: Error bundling function: signal: abort trap
    file:///src/import_map.json
    file:///src/index.ts
    assertion failed [block != nullptr]: BasicBlock requested for unrecognized address
    (BuilderBase.h:550 block_for_offset)
    I've narrowed it down to adding the createClient import for supabase from deno. If I remove that import (and the subsequent supabse.from call) it will deploy correctly. Here is the function code
    Copy code
    import { serve } from "https://deno.land/std@0.177.0/http/server.ts";
    import { createClient } from "https://esm.sh/@supabase/supabase-js@2";
    
    serve(async (req) => {
      console.log(Deno.env.get("SUPABASE_URL"));
      const supabase = createClient(Deno.env.get("SUPABASE_URL") as string, Deno.env.get("SUPABASE_ANON_KEY") as string);
      await supabase.from("posts").update({ complete: true }).eq("custom_id", "1611b321-baa4-46cc-9305-c9b70757633a");
      return new Response(JSON.stringify({}), { headers: { "Content-Type": "application/json" } });
    });
    h
    m
    +2
    • 5
    • 4
  • Error: Can't reach database server
    s

    supersonicart

    03/01/2023, 12:14 AM
    Currently getting this error for my db on the free tier (us-east-1); systems seem fine on status page and I hadn't changed any code when the error showed up. Is anyone else getting this error right now?
    j
    g
    • 3
    • 12
  • signInWithOtp return null data, also how to check if user exists or not (sign up vs sign in)
    p

    prenx4x

    03/01/2023, 12:24 AM
    Hello, I am using signInWithOtp function to sign up or sign in a user using their email address. signIn: async (context, event) => { const { data, error } = await supabase.auth.signInWithOtp({ email: context.email, }); if (error) throw error; console.log(data); return data; }, verifyOTP: async (context, event) => { console.log(context.OTP); const { data, error } = await supabase.auth.verifyOtp({ email: context.email, token: context.OTP, type: "magiclink", }); console.log(data, error); if (error) throw error; return data; }, 1) The data returned by the signInWithOtp is null. Shouldn't it return some info or is this normal for this function? 2) Is there a way to determine using signInWithOtp function if it signed up the user or signed in? I was expecting that the data returned by this would have that info, but it is null. Currently, the signInWithOtp function works, such that it sign's up a user if not already exists. However the problem is I need to know if it was a signup or signin since in the verifyOTP function I need to pass type = "signup" if it was a signup or "magiclink" if it was a signin Anyone has any insights on this? Any help is appreciated.
    s
    • 2
    • 3
  • Auth does not automatically close for Flutter
    e

    elliott

    03/01/2023, 12:36 AM
    Recorded a video to demonstrate - oauth is working correctly, but after authenticating the webview just sits there and the user has to click "Done", which isn't clear at all. Is there any workaround for this or one coming?
    t
    • 2
    • 2
  • Advice on custom row ordering
    n

    nimo

    03/01/2023, 12:47 AM
    Hey all 🙂 I have a table (event) in postgres that has a HAS MANY relationship with a sub table (invites). I'd like to allow users to customize the order of the invites. I'm curious if anyone has advice on the most efficient way to store that row order information? The two ideas I have are either storing it as a JSON array in the event table, or a "order" column on the invites table. Curious if there are any tradeoffs to be aware of?
1...149150151...230Latest