https://supabase.com/ logo
Join Discord
Powered by
# help-and-questions
  • column users.deleted_at does not exist when trying to send password recovery email from supabase ui
    j

    jopfre

    02/14/2023, 6:35 PM
    After running the migration scripts shown here: https://supabase.com/docs/guides/platform/migrating-and-upgrading-projects When I click Send password recovery under Authentication in the new instance's supabase ui I get a notification
    Failed to send password recovery: failed to make recover request: Unable to process request
    When I check the logs I see
    column users.deleted_at does not exist
    Everything works fine on the supabase instance I am migrating from so I believe the issue to be with the migration script or perhaps the new instance is now on a new version of some software? Has anyone received this error before or have any ideas how to resolve? https://github.com/supabase/supabase/discussions/12420
    g
    n
    • 3
    • 11
  • Connection limit or something?
    j

    JoshTheNerd

    02/14/2023, 7:19 PM
    I'm developing a project using nextjs, supabase, and prisma but all of a sudden I'm getting this error in the supabase dashboard..
    g
    • 2
    • 19
  • open source
    g

    GautamArora

    02/14/2023, 7:27 PM
    If I understand correctly, this -> https://github.com/supabase/supabase/issues/12417 issue demands to install the storybook package inside
    packages/ui
    directory with all the related libraries that were present in the old ui repository, right?
    g
    • 2
    • 2
  • Mapping a SupabaseStream to a UserResponse Stream
    t

    TobiasBm

    02/14/2023, 7:33 PM
    Iam trying to map a stream object into a UserResponse Object. I have the following. final streamProfiles = supabase.from("profiles").stream(primaryKey: ["id"]); This gives me a SupabaseStreamBuilder which is all fine and it provides me the data I want in an array of objects, however when I try to use it in my streambuilder in the widget tree it wont let me traverse the array of object. here is the way I try to access the data:
    Copy code
    dart
    StreamBuilder(
      stream: streamProfiles,
      builder: (context, snapData) {
      print(snapData.data); 
      // I want to be able to do snapData.data.id, .title etc.. but I cant
        return Text("ello world");
      }),
    I have a UserResponse object that I want it to map to. The class looks like this:
    Copy code
    dart
    class UserRequest {
      String id;
      String firstname;
      String lastname;
      String email;
    
      UserRequest(
          {required this.id,
          required this.email,
          required this.firstname,
          required this.lastname});
    }
    Just a simple class for now. I hope somebody can provide me some insight on how to work proberly with streams. Best regards Tobias!
  • can i copy tables between orgs & projects?
    d

    Domcario

    02/14/2023, 8:28 PM
    (see pic) i have
    org a
    and
    org b
    , each with their own
    project 1
    . org a's project 1 has 6 tables that i'd like to duplicate in structure (not contents, just columns fkey relations, delete cascade, etc...) to org b's project 1...is that possible? i'm the owner of both organizations and both projects
    g
    • 2
    • 10
  • Generating user session on server after calling auth.admin.createUser
    l

    lawnday

    02/14/2023, 9:12 PM
    Hi! I'm working on a flow for passwordless/OTP authentication with Supabase that I want to work like this: 1. The user fills out a sign up form that doesn't include a password (for our purposes we can pretend it's just an email we're collecting) 2. We create the user's account on the server using
    auth.admin.createUser
    . 3. The user gets an initial session back and has access to the app without having to log in via OTP 4. The next time the user comes back, they use the normal OTP sign in flow to sign back in Step 3 is my problem. I really want my user to just be logged in when they first create their account, but I can't figure out any way to do that with a OTP flow. Are there any workarounds for this?
    g
    r
    • 3
    • 13
  • How to sign a custom JWT inside edge function?
    e

    eshnil

    02/14/2023, 9:26 PM
    I'm using Supabase Auth with email as provider. However, my app allows users to create multiple API keys with further limited permissions. Such an API key should be sufficient to get access to relevant rows without having to know user's own email/password. I thought I will create an edge function, which takes an API key as an argument, and creates a new JWT - with an additional custom claim - that supabase client will accept. Then the RLS policy can apply rules based on this custom claim. I could not find an official example of this requirement (multiple API keys per user). Here are my questions: - Which JWT library is recommended in edge function (i.e. Deno + Typescript)? - Will an edge function have access to
    Deno.env.get('JWT_SECRET')
    or does it have to be set up manually? - Since I will be creating the complete JWT myself, what claims are necessary? For eg: do I have to have
    "role": "authenticated"
    in the JWT? I don't want to give the API key full access to the user.
    • 1
    • 4
  • 42501 | permission denied for schema public
    t

    Tempest

    02/14/2023, 10:51 PM
    Error: { code: '42501', details: null, hint: null, message: 'permission denied for schema public' } I have tried nearly everything to fix this:
    SELECT current_user;
    returns postgres, so postgres is the current_user. I've tried granting so many permissions, and they returned as a success and I still get permission denied when trying to insert data into the tables under public. I'm able to create the tables under public just fine though, I'm also the owner of the project. I have tried nearly every solution from google and from cntrl-f'ing similar problems in this discord and nothing is working, only solution I see is to just remake the entire project which is something I'd like to avoid any suggestions?
    g
    r
    • 3
    • 50
  • Concrete Supertable select query
    s

    stefikira

    02/14/2023, 11:05 PM
    Hello, is there a way to select a Concrete Super table(Base parent table) relationship as described here https://stackoverflow.com/questions/922184/why-can-you-not-have-a-foreign-key-in-a-polymorphic-association or here https://www.slideshare.net/billkarwin/practical-object-oriented-models-in-sql in PostgREST, flutter SDK?
    Copy code
    await supabase.from(_table).select<PostgrestList>('''
    
    '''
  • Failed to delete user: property deleted_at should not exist
    r

    Rasta

    02/14/2023, 11:22 PM
    Hello, i just created a database to test supabase, i created a user with sveltekit, all good, get the email confirmation and all but when i try to delete it from the dashboard it doesn't let me, i get the alert msg: "Failed to delete user: property deleted_at should not exist" First and only user, no other config changed, fresh created database. the code im using to create the user:
    Copy code
    import { AuthApiError } from "@supabase/supabase-js"
    import { fail, redirect } from "@sveltejs/kit"
    
    
    export const actions = {
        register: async ({ request, locals }) => {
            const body = Object.fromEntries(await request.formData())
    
            const { data, error: err } = await locals.sb.auth.signUp({
                email: body.email,
                password: body.password,
            })
    
            if (err) {
                if (err instanceof AuthApiError && err.status === 400) {
                    return fail(400, {
                        error: "Invalid email or password",
                    })
                }
                return fail(500, {
                    error: "Server error. Please try again later.",
                })
            }
    
            throw redirect(303, "/")
        },
    }
    am i missing something?
    g
    • 2
    • 10
  • RLS with own auth?
    m

    Marius.Dmn

    02/14/2023, 11:43 PM
    The users on my website are authenticated using a crypto wallet. Is it possible to use RLS with a custom auth method?
    o
    r
    • 3
    • 2
  • No provider_refresh_token when signing in with Google oauth provider
    j

    julo

    02/14/2023, 11:54 PM
    Hello! In reading through the Discord, I understand that it is our responsibility to use the
    provider_refresh_token
    in order to refresh the
    provider_token
    when it expires. This makes sense to me. However, I am noticing that when I sign in with google (via
    signInWithOAuth({ provider: 'google' })
    ), the Session returns a null
    provider_refresh_token
    , so it is not possible for me to fetch a new provider token. Is this expected behaviour?
    • 1
    • 3
  • POST TO Supabase Storage Via AXIOS
    a

    ali

    02/15/2023, 1:16 AM
    I am using AWS Lambda which does not play well with ES6 imports like the supabase-js client. Can I post to storage via a axios POST request? If so can anyone provide a sample request?
    g
    • 2
    • 11
  • S3 URL to Supabase? (Using Node streams?)
    w

    WolfroseWe

    02/15/2023, 1:19 AM
    I've spent a mind numbing amount of time trying to download a file from an S3 bucket (from another service) to our Supabase instance. Does anyone know how you can stream from the S3 bucket to Supabase? Supabase's upload() only accepts the file and I've tried using Node's stream API to stream chunks to Supabase. Has anyone done this or know a way to do it?
    g
    • 2
    • 1
  • can i use auth-helpers-react in React (CRA/Vite) & any reference repos using react
    e

    Explorer

    02/15/2023, 3:37 AM
    I understand that auth-helpers are used for managing ssr auth, but can i auth-helpers-react in a react app? I didn't find any examples using them together, I have a next application for payments, auth and marketing site and a vite-react application Also can anyone share any reference of any larger repos for using supabase-js 2.0 and react (other than user-management eg) with some guide to best practices
  • Self-Host storage file size limit
    p

    pckimlong

    02/15/2023, 3:44 AM
    I couldn't upload file with larger size than 50mb in self-hosting version. I've try update this in .env
    Copy code
    FILE_SIZE_LIMIT=52428800
    But It's seem not worked
  • "Resource not found" when using getBucket...
    r

    rchrdnsh

    02/15/2023, 4:00 AM
    Using supabase and sveltekit... trying to use getBucket, like so:
    Copy code
    js
    let bucket;
    
      const getBucket = async () => {
        try {
          loading = true
    
          const { data, error } = await supabase.storage.getBucket('avatars')
    
          if (data) {
            bucket = data
            console.log(`Bucket: `, bucket)
          }
    
          if (error) throw error
        } catch (error) {
          if (error instanceof Error) {
            failure(error.message)
          }
        } finally {
          loading = false
        }
      }
    
      onMount(() => {
        getBucket()
      })
    ...but i keep getting the error:
    Copy code
    The resource was not found
    ...I can't find any documentation or resources beyond the docs which only gives the basic function, so not sure what to do...
    s
    • 2
    • 3
  • Functions execution time limit?
    i

    invig

    02/15/2023, 8:10 AM
    Are there any limits on how long an edge function can run for?
  • Edge function returning SSE connection causes other functions to hang indefinitely
    d

    DeChill

    02/15/2023, 8:38 AM
    Hi all! I have two edge function deployed. One is just a simple "Hello World" echo, while the other one returns an SSE connection that pushes messages every second. If the SSE function is running, trying to call the other function results in the connection stalling and being aborted after ~90 seconds. However, this only happens on the same connection. If I open the page with another Browser, the "hello-world" function completes as normal. Is this a limitation of the Platform or is it more likely I'm doing something wrong with my SSE response? Thanks in advance!
    s
    • 2
    • 13
  • Building an API on one function
    h

    hoj

    02/15/2023, 8:45 AM
    Hi there, longtime firebase dev coming to supabase for the first time. I've noticed that 1. Supabase recommends fat functions https://supabase.com/docs/guides/functions/quickstart#organizing-your-edge-functions 2. You can only serve one function locally at a time https://supabase.com/docs/guides/functions/quickstart#limitations That got me thinking maybe I should just build a whole REST API on one function, with multiple routes & methods. Is this not recommended? I'm used to just building callable functions on firebase functions for each single use, but maybe that's not an ideal approach.
    g
    r
    l
    • 4
    • 16
  • Log out user after 7 days of inactivity? How long are tokens valid for?
    j

    JacobCoRo

    02/15/2023, 9:25 AM
    we are using
    import { useSupabaseClient } from '@supabase/auth-helpers-react';
    When we call
    auth.signInWithPassword
    how long does the token last? I only see one cookie in the browser
    supabase-auth-token
    Does that include both a refresh and session token? I see an option in the dashboard to change the session duration. But how long does the refresh token last and where can I set that?
    w
    g
    • 3
    • 12
  • 406: RLS Policy error
    s

    SimonPotvin

    02/15/2023, 11:08 AM
    Hello, I want to have a policy on the table banned_accounts, where READ is allowed if the banned_accounts.uid = auth.uid() OR if the authenticated user (auth.uid()) = users.uid has the column is_admin set to true. My banned_accounts SELECT policy is as follow: ((auth.uid() = uid) OR ( SELECT users.is_admin FROM users WHERE ((users.uid)::uuid = auth.uid()) )) I get this error: GET https://{API_URL}/rest/v1/banned_accounts?select=*&uid=eq.3886f884-66cf-45fd-96b1-4345f5c205a2&limit=1 406 {code: 'PGRST116', details: 'Results contain 0 rows, application/vnd.pgrst.object+json requires 1 row', hint: null, message: 'JSON object requested, multiple (or no) rows returned'}
    s
    g
    • 3
    • 6
  • can't find the RPC, but it does.
    d

    dev Joakim Pedersen

    02/15/2023, 11:21 AM
    In my app I got this error.
    "Could not find the public.dev_get_filtered_products(a, b, pbrand, pname, ptype, sid) function or the public.dev_get_filtered_products function with a single unnamed json or jsonb parameter in the schema cache"
    Had it several times before with other RPC's but then they did not work. what is funny about this one is that it works. I got one for "dev" and one for prod. and they do work on frontend just like they should I have reloaded schema cache. I have also deleted the function and added it again since sometimes that have been the trick. But alas this error is there. a bit annoying having this red text here. I also checked if my parameters are in the right order. but not that either 😕
    g
    • 2
    • 2
  • How to handle reliability of background jobs?
    g

    gintruxx

    02/15/2023, 12:48 PM
    Hey guys, I wonder about database triggers and repeat policy, I hadn’t really worked on backend before. Let’s say I want to build a feature where user uploads pdf file and some number needs to gets parsed from it. I think I should have a table e.g “jobs_pdfparsing”. I upload pdf file to the cloud, and make insert into this table, referencing pdf url in it. I can have an cloud (edge) function, which takes job ID as parameter, retrieves the pdf, parses it, updates the row to mark the job as completed. I could use database on-insert trigger to call the cloud function but how can I ensure reliability of such a job? E.g if function doesn’t complete or completes with error, I need some kind of repeat policy. If server crashes, I need the job to restart as soon as possible. If function takes too long, I probably want to cancel and restart since something has probably went wrong. And I don’t need >1 worker accidentally doing the same job at the same time. But I do need >1 worker doing different jobs if there is a longer queue of pending jobs What should help with such case? It may be something obvious, however, I hadn’t worked on backend earlier.
    s
    j
    • 3
    • 5
  • Trying to use an NPM package in a serverless function
    h

    Hugos

    02/15/2023, 1:16 PM
    Copy code
    ts
    import { Chess } from 'npm:chess.js@0.13.4';
    When trying to use this I get the following error:
    Copy code
    ts
    error: Uncaught (in promise) Error: Module not found "npm:chess.js@0.13.4".
          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)
    Is it possible to use npm packages in here?
    g
    s
    • 3
    • 21
  • Nuxt3 examples of supabase auth: email+password, password reset, email confirmation
    j

    jj_sessa

    02/15/2023, 3:26 PM
    Im looking for some examples for a full use flow in supabase for nuxt3, the examples for auth in the supabase repo are all pretty basic and use magic links, does anyone have any good examples or references for handling the more tedious features such as password reset flows and email confirmation flows.
    s
    • 2
    • 5
  • self hosting
    h

    Ho3einvb

    02/15/2023, 3:38 PM
    Hello, I installed Supabase on my server, but it has been on (Connecting ro default project) for a long time and has not changed
    s
    • 2
    • 21
  • Run multiple supabase functions locally
    r

    rbl

    02/15/2023, 3:55 PM
    When will supabase functions running multiple locally be supported? This is the only roadblock I'm running into with my local dev
    g
    • 2
    • 6
  • how to create postgresql types in supabase
    g

    Grimmjoww231

    02/15/2023, 3:56 PM
    hey guys i was opening a new table and realised i want an enum type for industries that i am choosing to use. i found we can do that in postgres but will we be able to do it with supabase?
    g
    • 2
    • 2
  • t3 + Supabase
    s

    Smiley

    02/15/2023, 4:05 PM
    I was wondering if anyone was able to run the t3 stack which uses prisma with supabase. I really like having some kind of an API behind my site which trpc is perfect. But I know supabase client only works in front end, and with prisma there’s a lot of stuff not working still great(real-time is not really possible from what I researched) and it’s a hassle to get prisma to work with rls. I might be over thinking this but if anyone has more info, it’d be great if you shared some info 🙂
    d
    • 2
    • 8
1...132133134...230Latest