https://supabase.com/ logo
Join Discord
Powered by
# help-and-questions
  • Query from sveltekit helpers on public table doesn't return any rows.
    a

    AVEN

    02/03/2023, 10:51 AM
    I have a table
    characters
    with 1 row, when I open a page on my site it sends this query to the database:
    await locals.sb.from('characters').select('*');
    . This returns an empty array in
    data
    . I don't have any permissions locking any public tables right now and the user is authenticated.
    locals.sb
    is a
    TypedSupabaseClient
    and right before the query I am checking if the session is valid and the user is authenticated.
    • 1
    • 1
  • Not able to get any data in flutter
    n

    Neelay

    02/03/2023, 12:26 PM
    So i am trying to fetch data from the product table but all i am getting is null i used this getdetails() async { var response= supabase .from('product') .select() // .order('MRP', ascending: true) .then((value) { print(value.toString()); }); print(response.toString()); }
    s
    a
    +2
    • 5
    • 8
  • How are new releases of Supabase repos handled?
    d

    drewbie

    02/03/2023, 12:36 PM
    Trying to understand the order in which Supabase repos are updated and made available. Specifically there is a PR that was merged, and as part of my local development, and in production Supabase accounts, how do I know if this is included? I am using the Supabase CLI and I’m not sure if I need to explicitly set versions for the dependencies (if so, where). Here’s the PR that I’m trying to enable locally and in prod, any help is appreciate. https://github.com/supabase/postgres/pull/509
    y
    • 2
    • 1
  • SvelteKit Auth session, I'm stuck x)
    h

    HugoDuprez

    02/03/2023, 12:59 PM
    Hi there! My problem is simple: the +layout.ts exported data overrides the +layout.server.ts ones 🙂 Let's sat in the +layout.server.ts I return {session: xxx, myStuf: yyy} and in the +layout.ts I return only {session: xxx} to get the session on the client when needed (ex: on login): The final result will be {session: xxx} and myStuf will be not present :/ Have you an hint?
    s
    d
    • 3
    • 11
  • v1 to v2 js api, what to do with auth.api.*
    k

    Kilian

    02/03/2023, 1:07 PM
    I'm currenly using supabase.js v1 in remix, based on https://github.com/arpitdalal/remix-supabase-auth but am trying to upgrade to v2. CreateClient is easy to change, but this implementation is using a lot of auth.api.* functions like
    auth.api.signInWithEmail
    (see https://github.com/arpitdalal/remix-supabase-auth/blob/main/app/api/supabase-auth.server.ts#L80 ) auth.api no longer seems to exist in v2 so I'm unsure what the upgrade path here is. Any tips?
    s
    • 2
    • 10
  • 502 error when logging in with Email and Password
    l

    Leky

    02/03/2023, 1:53 PM
    Hi, so I've left my project for a week or 2 and when i restored it, everything impoded. My login using email and password is not working and is returning 502 error but the query of a custom datatable still works fine. Any ideas what should i do? Also tried creating a new user and the signUp() also returns 502.
    g
    t
    s
    • 4
    • 8
  • Primary key issues on image table
    d

    dev Joakim Pedersen

    02/03/2023, 1:56 PM
    I have an image_table. where image_id is an automatic sequential number from supabase. works brilliant but I found an issue. My colleague added a batch of 5000 images. from a big store. and since I was working I said maybe jump 100 indexes before me so we do not get an issue. it should understand to jump to the end when it meets where you started. Turn out it did not. so now it says that pkey already exist rather annoying. Is this common or a bug? I was kind of expecting it to understand this
    g
    • 2
    • 4
  • Did supabase login have problems yesterday?
    t

    Trevvy

    02/03/2023, 2:15 PM
    Yesterday whilst creating login, I was getting this error:
    AuthRetryableFetchError: Unexpected token o in JSON
    . I came back 2 hours later to try and figure out what was happening, yet I was unable to re-produce. So was this something on Supabases side? Was also getting 500 status code
    • 1
    • 2
  • Supabase authentication
    g

    goldyman

    02/03/2023, 2:30 PM
    I'm having issues understanding the meaning of this: "Host your data in 8 different locations" written on the home page
    g
    s
    • 3
    • 3
  • How do I set the env var INBUCKET_SMTP_DISCARDDOMAINS?
    b

    BilboHicks

    02/03/2023, 4:11 PM
    I'm trying to get Cypress working with MailSlurp so I can test emails are being sent but Inbucket is catching them. I think that setting the environment variable
    INBUCKET_SMTP_DISCARDDOMAINS=mailslurp.com
    should do the trick but I can't figure out how to set this permanently inside the Docker container. Anyone know how to do this?
  • Login does not work on local machine if using domain other than localhost
    r

    Roko

    02/03/2023, 4:13 PM
    I've changed host file so that otherdomain.test would link to 127.0.0.1. I'm trying to login using @supabase/auth-helpers-sveltekit, but no cookies are being set. It works well both on localhost and 127.0.0.1. Any ideas?
    s
    • 2
    • 7
  • Saving the total count for each key/value in jsonb column
    j

    jinsley8

    02/03/2023, 4:34 PM
    I have a jsonb column that I'm using to filter results when I fetch data from a table. The jsonb data for each row has multiple key/values like this that vary for each row:
    Copy code
    js
    // row 1
    {
      "key1": "value1",
      "key2": "value2",
    }
    // row 2
    {
      "key1": "value1",
      "key2": "value5",
    }
    My filters are a group of checkboxes. I want to show the total results beside each filter option like:
    Copy code
    Key1 - Filter
    -- Value1 (count total)
    -- Value2 (count total)
    -- Value3 (count total)
    
    Key2 - Filter
    -- Value1 (count total)
    -- Value2 (count total)
    -- Value3 (count total)
    Is there an optimal way to achieve this count for each value? I'm learning PostgreSQL so not sure of the best way to approach this.
    • 1
    • 1
  • Log the signed in user
    p

    pers0n

    02/03/2023, 4:47 PM
    I set up github auth and that is working fine, but now I want to console log the user. I have tried supabase.auth.user(), and supabase.auth.currentUser() but I am getting this error:
    Copy code
    TypeError: _utils_supabase__WEBPACK_IMPORTED_MODULE_1__.supabase.auth.user is not a function
    And if I pass it as not a function (just supabase.auth.user) I get returned
    undefined
    This is my index.js file where I am calling it:
    Copy code
    js
    import { supabase } from '../utils/supabase'
    
    export default function Home({ lessons }) {
      console.log(supabase.auth.user());
      return (
        <div className="w-full max-w-3xl mx-auto my-16 px-2">
          Test
        </div>
      );
    }
    I followed the docs here https://supabase.com/docs/reference/dart/auth-updateuser but it didn't work for me. I just want to log the current signed in user.
    g
    • 2
    • 8
  • Supabase API Keys security question
    d

    DisamDev

    02/03/2023, 4:53 PM
    Hi, I have a question, when you have a error in supabase in the browser's console it says the error in the request but if you see in the request's headers you can see the api key of the project. Can it be hidden? This is because if in the real app when is in production it has an error the users can see the private api key of the project, like this (image).
    s
    g
    +2
    • 5
    • 48
  • RLS keeps returning 204 for update
    a

    ashman

    02/03/2023, 5:33 PM
    Help, no matter what I try I am unable to get my RLS to work as intended, can't go to prod... Let's take this table (Shops) as an example: Shop: { id, name, .... , owner_id } Policy for shop UPDATE is: USING (uid() = owner_id) and CHECK (uid() = owner_id) for AUTHENTICATED users INSERT for shops targeting authenticated customers is working but Update is not UPDATE keeps returning 204 - no results, but I can verify on the db that owner_id = user.id. Even if changed to public or service_role I am getting the same result for other tables as well (not getting RSL violation error, just no results.) After a lot of research, I thought this has something to do with using supabase_admin vs. postgres as owner, but changing that didn't make any difference either. Any help would be greatly appreciated!
    g
    • 2
    • 27
  • TS-database-scheme in Nuxt.js
    l

    Lioker

    02/03/2023, 5:37 PM
    Hello, I have a little question and I hope that I'm not the only one with this problem. I use Nuxt.js with the supabase module and everything works fine. But I want to use a database-scheme file and I don't know where to put it, because I don't have a createClient function. Just the .env file with the codes, that's it. Does somebody have a clue how to solve this problem?
    s
    • 2
    • 2
  • Any idea how to handle this?
    u

    .davdi

    02/03/2023, 7:13 PM
    How would i handle
    getServerSideProps
    in NextJS with supabase auth? Is it possible at all? My code currently look like this, but obviously this just returns me
    undefined
    Copy code
    js
    export async function getServerSideProps() {
      const user = await supabase.auth.getUser().data;
      return {
        props: {
          user: user,
        },
      };
    }
    g
    • 2
    • 5
  • How many GB can Supabase Storage store?
    k

    kuna

    02/03/2023, 7:18 PM
    How many GB can Supabase Storage store?
    g
    • 2
    • 1
  • Where can I go to view my ticket requests and cancel them?
    g

    garyaustin

    02/03/2023, 7:38 PM
    I don't think that exists. Did you get the confirm email? If so just respond to that.
    d
    • 2
    • 1
  • any ideas on how to mock the supabase client?
    k

    KremBanan

    02/03/2023, 8:06 PM
    I want to mock the supabase client so I can write tests without needing to do network calls
    • 1
    • 1
  • Replicate Supabase Instance
    j

    James Q Quick

    02/03/2023, 8:30 PM
    Hey there! I'm using Supabase for two open-source projects, a Discord bot and a Website for my Learn Build Teach Discord. I want to make it easy for other developers to replicate the production Supabase instance for dev, test, etc. Is there a good way to export/import from my instance to another one that they create? Do I need to run like a manual dump myself?
    g
    s
    c
    • 4
    • 6
  • Update on Realtime Filters
    a

    AliCodes!

    02/03/2023, 8:32 PM
    I found this older thread on this topic: https://canary.discord.com/channels/839993398554656828/1025768590110117948 I'm wondering, have there been any updates on more complex filters on Realtime PG Subscriptions? Just being able to check against multiple columns would be nice, but being able to
    join
    across multiple tables would be really awesome!
    g
    p
    • 3
    • 34
  • Channel subscription
    k

    kyds3k

    02/03/2023, 9:36 PM
    I have this code in a function, firing on a button click:
    Copy code
    channel.subscribe().send({
          type: 'broadcast',
          event: 'question-reveal',
          payload: {
            message: 'question-active'
          }
        })
    It works the first time, but every time after it tells me:
    Uncaught (in promise) tried to subscribe multiple times. 'subscribe' can only be called a single time per channel instance
    Is there a way to check for subscription to a channel beforehand? Or do I need to unsubscribe first?
    j
    • 2
    • 2
  • Ordering by column in foreign table not working
    a

    Atrox

    02/03/2023, 10:28 PM
    According to the documentation (https://supabase.com/docs/reference/javascript/order#:~:text=Response-,Order%20the%20query,-Order%20the%20query) the following query should order by the
    title
    field from the
    projects
    table:
    Copy code
    ts
    const { data } = await supabase
      .from('projects_profiles')
      .select(`project:projects(*)`)
      .order('title', {
        ascending: true,
        foreignTable: 'projects',
      });
    No matter what I've tried, I cannot get ordering to work through a foreign table.
    j
    r
    +3
    • 6
    • 51
  • no such file or directory
    g

    goldyman

    02/03/2023, 10:38 PM
    I'm trying to upload an image directly in a bucket. Is this possible? Here is my sample code
    Copy code
    dart
    Future<void> saveAvatar(Uint8List avatar) async {
        try {
          final avatarFile = File.fromRawPath(avatar);
          await _supabaseClient.storage.from('avatars').upload(
                '${_supabaseClient.auth.currentUser!.id}.png',
                avatarFile,
              );
          await _supabaseClient.from('users').update({'hasAvatar': true}).match(
            {'id': _supabaseClient.auth.currentUser?.id},
          );
        } catch (error, stackTrace) {
          Error.throwWithStackTrace(
            SupabaseSaveAvatarFailure(error),
            stackTrace,
          );
        }
      }
    I get an exception Cannot open file No Such file or directory. I'm not sure if generating a File from uint8List is ok for supabase. Is it breaking in the client or in remote. It looks like it's in remote, cause I see log of trying to post to "/object/list/avatars" My policy for insert in this bucket is
    Copy code
    ((bucket_id = 'avatars'::text) AND ((uid())::text = (storage.foldername(name))[1]))
    g
    • 2
    • 21
  • ffmpeg in function?
    d

    dvd

    02/03/2023, 10:52 PM
    Hi there! I'm trying to do some basic file transformation tasks on audio files uploaded to supabase storage. I was hoping to use ffmpeg in a supabse function in order to, as an example, convert newly uploaded audio files regardless of format to 128k mp3. This is pretty straightforward with ffmpeg, but I haven't found any clear examples of ffmpeg being run in a supabase function. I'm new to Deno, but I would think it would be possible with ffmpeg.wasm (https://github.com/ffmpegwasm/ffmpeg.wasm). Has anyone ever done this before? Any pointers for someone new to supabase functions / deno? Thanks!
  • Initializing session remotely
    n

    nateland

    02/03/2023, 10:57 PM
    So, I'm having a little customer flow where I have a client come into my site and they purchase something (my site is on Wix at the moment), I'm currently triggering a webhook in order to create their user. What I want is to be able to redirect them from the wix site to my app, but don't force them to sign in again - I want them to already be signed in. How can I do this?
    s
    • 2
    • 3
  • Supabase functions hangs
    s

    Shawn Conecone

    02/04/2023, 12:10 AM
    Hello, I have an edge function that simply returns "pong" when invoked. The dashboard says it is active, but when I try to invoke it, it does not let me do so. It just hangs and never returned anything. Maybe any pointers how to solve this issue?
    g
    • 2
    • 2
  • RLS with EXISTS not working
    v

    vjoohov

    02/04/2023, 1:05 AM
    My RLS is not working well. I checked i can get data well if i turn off RLS, and I checked that it works well in SQL console. What can be a solution?
    g
    • 2
    • 14
  • RPC method states no user found, but that's incorrect.
    d

    DanMossa

    02/04/2023, 1:42 AM
    I have a postgres function that's been working for a while. It deletes a user from
    auth.users
    which then cascades throughout the database.
    Copy code
    sql
    CREATE FUNCTION delete_account() RETURNS void
        SECURITY DEFINER
        LANGUAGE sql
    AS
    $$DELETE
    FROM auth.users u
    WHERE u.id = auth.uid();$$;
    When the code runs, I'm getting an error back stating
    Unhandled Exception: AuthException(message: User not found, statusCode: 404)
    The weird part is that I see the user being deleted from
    auth.users
    as well as everywhere else in my database. I'm not sure what's going wrong. Any ideas would be helpful! Thanks!
1...118119120...230Latest