https://supabase.com/ logo
Join Discord
Powered by
# help-and-questions
  • Is there a way to proxy deno cli commands to supabase cli when invoking edge functions?
    m

    mattnguyen

    03/03/2023, 6:01 PM
    I'm building an ml pipeline that involves using #mediapipe, which typically runs in the browser. When I import
    https://esm.sh/@mediapipe/face_mesh@0.4.1657299874?target=deno
    and call the constructor, I get this error:
    Copy code
    TypeError: Cannot read properties of undefined (reading 'pathname')
        at new s1 (https://esm.sh/v110/@mediapipe/face_mesh@0.4.1657299874/deno/face_mesh.js:19:2248)
        at new x3 (https://esm.sh/v110/@mediapipe/face_mesh@0.4.1657299874/deno/face_mesh.js:19:15116)
        at Server.<anonymous> (file:///home/deno/functions/process-landmarks/index.ts:28:20)
        at async Server.#respond (https://deno.land/std@0.168.0/http/server.ts:301:18)
    Presumably because the modules requires the location API. The deno docs (https://deno.land/manual@v1.29.4/runtime/location_api) indicate that I need to pass
    --location
    flag to the deno-cli command, but I don't see how this is possible with supabase. Any advice?
    • 1
    • 1
  • insufficient privilege on query column from pg_stat_statements?
    e

    ejkreboot

    03/03/2023, 6:17 PM
    I am attempting to do some profiling to see if I have specific queries in need of optimization. I am performing queries as suggested in the docs (https://supabase.com/docs/guides/platform/performance). However, for the queries I am interested in, I am getting
    <insufficient privilege>
    as the value for the
    query
    column so I cannot see what the actual query was. The queries in question were originally executed by the
    anon
    role. A stripped down version of my profiling query just to illustrate the issue is:
    Copy code
    select
      auth.rolname,
      statements.query
    from
      pg_stat_statements as statements
      inner join pg_authid as auth on statements.userid = auth.oid
    where rolname='anon';
    Is there a grant I can add to the default dashboard user (which I assume is
    postgres
    ?) to be able to see what these queries were?
    o
    l
    k
    • 4
    • 4
  • Getting an unresponsive database connection. Unable to recover with restart
    m

    Miguel Espinoza

    03/03/2023, 6:27 PM
    I have a staging (free-tier) database where I'm unable to connect anymore. I've reach the limit of 500GB, so in order to stay under the limit I've been truncating tables, this is ok for the staging database. But it seems today it may have reached a point where I can't recover. I can't access the database, restart or pause. Anyone ever experience this? I've contacted support, but in the meantime hoping I can get some help here.
  • Password reset with {{ .Token}} (OTP) and API call (cURL)
    i

    Irfan Ahmed

    03/03/2023, 6:54 PM
    How to use the OTP sent to the email? What Authorization should I use in my API call, The user is logged out and requests the password reset by entering their email id. I need to know how to authenticate the user with just OTP.
    g
    • 2
    • 7
  • Issues with inserting data into table
    h

    Hector Castro

    03/03/2023, 7:13 PM
    Hello all, I keep getting this issue when trying to insert data into a customers table I have.
    Copy code
    js
        const { data, error } = await supabase
          .from('customers')
          .insert([
            { fullname: customer.fullname, phone: customer.phone, email: customer.email, waiver_acknowledge: customer.waiver_acknowledge, style: customer.style },
          ])
    this is how I'm making the insert request.
    Copy code
    json
    {
      code: '42501',
      details: null,
      hint: null,
      message: 'new row violates row-level security policy for table "customers"'
    }
    This is what I get in return. I've tried researching but I can't really find an answer to my specific case.
    g
    • 2
    • 17
  • Can I use SupabaseCLI gen types on edge function?
    j

    jh

    03/03/2023, 7:41 PM
    I have an edge function, and was hoping to use the gen types from SupabaseCLI. However when I deploy I get the following error:
    Copy code
    Error: Error bundling function: exit status 1
    file:///src/import_map.json
    file:///src/index.ts
    file:///_shared/constants.ts
    file:///_shared/supabaseAdmin.ts
    file:///_shared/types.ts
    error: Uncaught (in promise) Error: The module's source code could not be parsed: Unexpected character '�' at file:///_shared/types.ts:1:1
          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 advice on this? Maybe it's just not do-able?
    • 1
    • 3
  • realtime works for a day then just stop
    t

    techleed

    03/03/2023, 8:02 PM
    just ran into a realtime subscription not working for my production backend server... if i restart my docker container that setup the supabase subscription it starts registering realtime again kinda important to my app, any reason why this can be? i didn't see any logs and wouldn't know where to look. i just see billing telemetrics in the supabase logs website
    g
    l
    • 3
    • 27
  • Auth component - possible to add input fields?
    c

    chrtravels

    03/03/2023, 8:19 PM
    I am using this component for login: https://supabase.com/docs/guides/auth/auth-helpers/auth-ui However it only comes with email and create password fields out of the box. Is there a way to add additional fields? It would be nice to be able to take a name input but I don't see anything in the docs.
    b
    • 2
    • 1
  • Quick way to sync prod db with local db
    n

    nateland

    03/03/2023, 8:59 PM
    Anyone got some tips here? Just looking for a one-liner command line
    g
    • 2
    • 4
  • Destroying SQL functions
    r

    Ruzelmania

    03/03/2023, 9:03 PM
    I keep getting this error for a function I am writing:
    Failed to run sql query: cannot change return type of existing function
    . If I simply change the name of the function in my SQL snippet it runs just fine. So, my question then is: how do I destroy functions? It doesn't seem like removing the snippet is doing the trick.
    g
    • 2
    • 6
  • Error handling of pgsql-http used in trigger function
    j

    Jannes

    03/03/2023, 9:15 PM
    I have a post table which is associated with an image file in storage. If a user wants to delete the post I want to automatically delete the file in storage as well. For that I am using the pgsql-http extension within an on delete trigger function on the post table. This part is working.
    Copy code
    create or replace function public.delete_post()
    returns trigger as $$
    declare
    s text;
    c text;
    image_url text;
    begin
    
    image_url = old.image_url;
    SELECT status, content INTO s, c FROM http((
      'DELETE',
      image_url,
      ARRAY[http_header('Authorization',(SELECT current_setting('request.headers', true)::json->>'authorization'))],
      NULL,
      NULL
    )::http_request);
    
    IF s::INTEGER > 200 THEN RAISE EXCEPTION '%',c; END IF;
    
    return null;
    END;
    $$ language plpgsql;
    But if there is an error in the pgsql-http call no immediate exception is raised (obviously). And therefore the deletion of the post is not getting rolled back. My question is now: How do I properly raise an exception with the response I get from pgsql-http in a way that the client response includes the correct response status and message. At the moment I just check if the status is not 200 and then raise an exception but that doesn't seem correct and by doing so I don't get the right status code within the client response. In other words how does supabase resolve sql exceptions to create the error object containing the status, hint, message etc.? And in what way do I have to raise an exception so supabase picks it up correctly? Thanks a lot!
    g
    • 2
    • 2
  • Supabase Auth with Nextjs and Prisma
    d

    desiboli

    03/03/2023, 10:04 PM
    Hi! I've been struggling with this for a while and can't find a straight forward way of doing this in the docs or any tutorial. I'm maby missing something... I've been trying to follow this getting started tutorial: https://supabase.com/docs/guides/getting-started/tutorials/with-nextjs But they are not using Prisma here. And I am confused when it comes to setting up the database schema. The "Create a table for public profiles" schema is adding the table to the DB but the `prisma db pull`command won't update my schema.prisma file with that model. the `prisma db pull`command gives me the following error:
    Copy code
    ✖ Introspecting based on datasource defined in prisma/schema.prisma
    
    Error: P4002
    
    The schema of the introspected database was inconsistent: The schema of the introspected database was inconsistent: Cross schema references are only allowed when the target schema is listed in the schemas property of your datasource. `public.profiles` points to `auth.users` in constraint `profiles_id_fkey`. Please add `auth` to your `schemas` property and run this command again.
    Could someone point me to the right direction, would appreciate it so much! 🙏
    b
    s
    +5
    • 8
    • 45
  • Debug 404 errors in API Edge Network logs
    j

    jinsley8

    03/03/2023, 10:07 PM
    I'm seeing some 404 POST request errors on one of my table endpoints
    /rest/v1/abc_endpoint
    in the API Edge Network log page. Is there any way I can find more information about this request like the post body?
    g
    • 2
    • 26
  • How to re-generate auth schema?
    s

    samuel83

    03/03/2023, 10:48 PM
    I accidentally deleted the auth schema in my supabase project when trying to run migration with Prisma. Is there any chance I can re-generate the auth schema again?
    n
    • 2
    • 4
  • Supabase JWT token expiring and not refreshing
    g

    gtims123

    03/04/2023, 12:18 AM
    I've noticed that in my react native app, after using it while logged into a user for a few days the app appears to not auto-refresh the user's session. I have autoRefreshSession set to true in my supabase client. Has anyone found this same problem? I think this is the related issue https://github.com/supabase/gotrue-js/issues/620 Are there any workarounds such that when this happens I can somehow manually refresh the session?
  • sync prod db with local db
    n

    nateland

    03/04/2023, 12:29 AM
    I'm looking at this documentation and I don't know if
    # Capture any changes that you have made to your database before setting up the CLI
    means my database
    locally
    or in
    prod
    . Please help 🙏
  • Looping in SQL help
    t

    tinyjetpack

    03/04/2023, 12:33 AM
    I'm new to SQL and relational databases in general so pls bare with me :D. I have two tables,
    templates
    and
    templates_tags
    . The
    templates
    table has a field called
    tags
    , which is an
    array
    of text. When a row is updated in the
    templates
    table, I want a trigger function to insert a row in the
    templates_tags
    table for each tag in the
    tags
    array. Performance is not a factor here, as these updates happen very infrequently. Is this still a bad idea? If not, any help on why the following gives the following error would be appreciated
    Failed to run sql query: loop variable of FOREACH must be a known variable or list of variables
    g
    • 2
    • 1
  • SQL Statement to Enable Realtime?
    j

    Jinx

    03/04/2023, 4:01 AM
    Hey everyone, I was wondering if anyone was aware of a SQL statement that can be executed to enable Realtime on a table? For instance, RLS can be enabled for a table using the statement “alter table table_name enable row level security;”. I searched through relevant areas of the documentation, but I can’t seem to find any similar statement for enabling Realtime. Thanks, Jinx
    g
    • 2
    • 2
  • How do I download 10k+ files from Supabase?
    a

    aneesh

    03/04/2023, 5:47 AM
    The query seems to limit me to just 1000 files. I've tried manually increasing the limit as well, and it doesn't help. This is my code:
    Copy code
    dart
    final supabase = SupabaseClient(SupabaseKeys.url, SupabaseKeys.secret);
    final bucket = supabase.storage.from('analytics-and-logs');
    final list = await bucket.list(searchOptions: SearchOptions(limit: 10000));
    final data = list.data;
    g
    n
    • 3
    • 2
  • How to pass in additional variables to email template?
    y

    YL

    03/04/2023, 7:53 AM
    Hi there, my application is using supabase-js for existing users to invite new users into the app
    Copy code
    const { data, error } = await supabase.auth.admin.inviteUserByEmail('email@example.com')
    Hence in my invite email, I would like to display something like:
    Copy code
    “{{ inviter_user }}  has invited you to join {{ organisation_name }}”
    Is it possible at all for me to pass in the ``inviter_user`` and ``organisation_name`` in the body of my API call and make it available to be used in the email template editor? If yes, I would appreciate guidance on how to pass-in and utilise the additional variables. Thanks in advance!
    g
    • 2
    • 2
  • Limiting data fetched for each user not overall
    s

    STILLWATER;

    03/04/2023, 8:44 AM
    We have a sql query in which we want to fetch some limited stories for some limited users each. I have the query in following notion with details of the tables. https://www.notion.so/st1llwater/SQL-Query-3f6e8263eaed4d40a3cd0994eb3db91a?pvs=4 Any help would be appreciated
  • Inner hint? Fetching Data
    r

    Razoth

    03/04/2023, 10:21 AM
    this may be incredible stupid, but what is meant by "inner hint" here: ?
    s
    • 2
    • 2
  • Cors errors
    k

    Kypac

    03/04/2023, 12:27 PM
    I'm having cors error when trying to get data from supabase, first time working with supabase. I have tried a few things from reddit post or github issues but couldn't fix it.
    s
    g
    • 3
    • 8
  • "PUBLIC_SUPABASE_URL" is not exported by...
    l

    Lar

    03/04/2023, 1:09 PM
    I followed Supabase SvelteKit configuration guide/example. However, Vercel is complaining. I found this same issue described here: https://stackoverflow.com/q/75201553 Is this a bug or what is a workaround? Thank you.
    s
    • 2
    • 3
  • HOW TO FIND THE AUTH TOKEN OF A USER IN SUPABASE ?
    r

    RAOUL

    03/04/2023, 2:26 PM
    Hello 🙂 for my front end , i need to find the auth token of a user when he signs up. Is there a request or a function i can create to do that ? Thank you
    g
    • 2
    • 4
  • session could not be found for this request
    v

    visheem 🚀

    03/04/2023, 2:34 PM
    Hey would anyone know why I get the following error only for Twitter login callback error_description: 'session could not be found for this request'
  • TypeError: supabase.auth.session is not a function
    c

    chrtravels

    03/04/2023, 3:18 PM
    Any thoughts on this error? I just installed Supabase a few days ago so the version is current. Using the following syntax:
    Copy code
    import { createClient } from '@supabase/supabase-js'
    const supabase = createClient(supabase_url, anon_key)
    
    const { data, error } = await supabase.auth.getSession()
    Otherwise the session is only available on the login component and not sure how to access, to get the current user, throughout the rest of the site. Alternatively, I thought maybe access the intialSession from SessionContextProvider as that is import from auth-helpers-react but not sure how that can be accessed either. ;-p Any direction is appreciated!
    g
    • 2
    • 8
  • Is https://ui.supabase.io/ the correct way to import supabase UI elements?
    m

    MDobs

    03/04/2023, 3:58 PM
    getting some errors when trying to import via ESM. as described here: https://github.com/supabase/ui/issues/388
    s
    • 2
    • 9
  • RealTime not working today?
    l

    lakis94

    03/04/2023, 4:21 PM
    Hi it seems that realtime is not working for me today, any ideas?
    g
    q
    • 3
    • 52
  • Supabase.com website basic authentication issue
    m

    MartiN

    03/04/2023, 4:23 PM
    I signed up in Supabase with Github - primary email one@gmail.com. I made a new account in Subapase with password - email two@gmail.com. I switched the primary email in GIthub to two@gmail.com and now I can't log into Supabase with my Github account anymore. All I wanted was actually to just change my email in Supabase but that was not possible.
    g
    • 2
    • 4
1...153154155...230Latest