https://supabase.com/ logo
Join Discord
Powered by
# help-and-questions
  • Python auth error [Solved]
    c

    cappy

    08/18/2022, 5:30 AM
    Howdy! I'm receiving this error when trying to retrieve data from my database. The error relates to the bottom line in code excerpt below. Currently on: Python 3.8.9 > Traceback (most recent call last): > File "/Users/cappy/Library/Python/3.8/lib/python/site-packages/postgrest/_sync/request_builder.py", line 62, in execute > return APIResponse.from_http_request_response(r) > File "/Users/cappy/Library/Python/3.8/lib/python/site-packages/postgrest/base_request_builder.py", line 156, in from_http_request_response > return cls(data=data, count=count) > File "pydantic/main.py", line 341, in pydantic.main.BaseModel.__init__ > pydantic.error_wrappers.ValidationError: 1 validation error for APIResponse > data > You are passing an API error to the data field. (type=value_error) > > The above exception was the direct cause of the following exception: > > Traceback (most recent call last): > File "app.py", line 18, in > data = supabase.table('tablex').select('column1').execute() > File "/Users/cappy/Library/Python/3.8/lib/python/site-packages/postgrest/_sync/request_builder.py", line 64, in execute > raise APIError(r.json()) from e > postgrest.exceptions.APIError: {'message': 'No API key found in request'} I've based this on the github readme: https://github.com/supabase-community/supabase-py#selection-of-data I also load and init a flask app. I've removed this code as not relevant. My keys are stored in a .env file in my project directory > from supabase import create_client, Client > from dotenv import load_dotenv > import os > > #load dotenv files > load_dotenv() > > #retrieve required env variables > url = os.environ.get("SUPABASE_URL") > key = os.environ.get("SUPABASE_KEY") > > #create supabase client > supabase: Client = create_client(url, key) > > #try to retrieve data > data = supabase.table('XXX').select('ZZZ').execute()
    • 1
    • 1
  • v2 Realtime not working as expected.
    u

    49Ryann

    08/18/2022, 6:15 AM
    Can I assume this is still not final until it's announced more in the following days? This code sits in an rxjs stream where a new id is presented every time the route changes. I Unsubscribe from previous contact and re-sub to the new. But after I route away from an id and then back to the original it stops getting updates? This seemed to be working fine withe the previous implementation
    Copy code
    this.realtime?.unsubscribe()
          this.realtime = this.ss.client
            .channel(`public:contact:id=eq.${contact.id}`)
            .on(
              'postgres_changes',
              {
                event: 'UPDATE',
                schema: 'public',
                table: 'contact',
                filter: `id=eq.${contact.id}`,
              },
              ({new: contact}) => {
                console.log('contact', contact)
                this.contact = contact
              }
            ).subscribe()
    Copy code
    "@supabase/supabase-js": "^2.0.0-rc.2",
    g
    • 2
    • 13
  • Supabase v2 - Slack provider
    m

    Mathiassio

    08/18/2022, 7:13 AM
    I'm trying to update to v2 rc, and according to the this post: https://supabase.com/blog/supabase-js-v2#new-auth-methods There are new auth methods. Which one is the correct one for the providers? I'm trying to use Slack as a provider. Here is the old way:
    Copy code
    async function signInWithSlack() {
        const { user, session, error } = await supabase.auth.signIn({
          provider: "slack",
        });
      }
    s
    • 2
    • 2
  • Local development - Postgrest container keeps restarting
    e

    Equinox

    08/18/2022, 8:55 AM
    Hello After playing around with the UI and starting to prototype some stuff in production (I got into it too quickly 😬) I decided to follow this tutorial https://supabase.com/docs/guides/cli/cicd-workflow to setup a proper dev environment, I ran all the commands up to
    supabase db remote commit
    which created the migration but then as soon as I want to startup my local supabase again with
    supabase start
    it keeps on throwing errors I have also tried moving the migration file out of the folder and starting the database then putting the file back and running
    supabase db reset
    but it doesn't work either When I setup my supabase project I used the Next.js subscription starter so I have some enum types already created that I'm not currently using e.g:
    pricing_type
    , I tried deleting those from the UI and running a migration again but I cannot because of errors with the shadow database I also tried removing those specific enum types from the migration but then the migration throws some other error. I have also tried re-running everything with the latest update of the Supabase CLI but it didn't change anything
    • 1
    • 5
  • How to search across multiple columns and tables
    w

    Waldemar

    08/18/2022, 9:34 AM
    Hi guys. For our app I want to implement a "global search". Basically a search field in the top nav bar where users can enter a (part of) a vendor / client / product / ... name / description / ID etc. It can be just a simple case-insensitive matching ala
    LIKE
    , doesn't have to be super smart. What options do I have to implement this with Postgres / Supabase JS client? The only thing that comes to mind is a
    VIEW
    with
    UNION ALL
    or similar. But then do something like this with Supabase JS client:
    Copy code
    .or('like.id.%search string%, like.name.%search string%')
    Any ideas are welcome!
    g
    • 2
    • 1
  • Query data with Next.js
    m

    Mathiassio

    08/18/2022, 10:31 AM
    Has anyone found a good way to query for data when using Next.js. I tried using useSWR (https://swr.vercel.app/) and it works, but I'm not sure if that is the recommended way of doing it? I find it cumbersome to use useEffect and set a state each time I want to query for data. Any good suggestions?
  • Supabase.js Error 413 on `select`
    q

    QueueBot

    08/18/2022, 10:31 AM
    I've got a fairly simple schema which is giving me a
    413
    when I try to query it.
    Copy code
    ts
    ...
      // 413
      const { data, error } = await supabaseClient
        .from<Row_Heartbeat>('heartbeats')
        .select('*')
        .eq('application_id', applicationID)
        .order('created_at', { ascending: false })
        .limit(27);
    
      if (error) {
        throw error;
      } else {
        return data;
      }
    ...
    The query works fine in the SQL editor (

    https://storage.queue.bot/t/930bm9voa.pngā–¾

    ). There is no documentation on 413 in any docs, GitHub issues, or help channels on Discord. I have three questions 1) What does this error mean in the context of Supabase? I know HTTP 413 is "request too large" 2) How can I troubleshoot/fix the problem? 3) What caused the problem?
    s
    g
    • 3
    • 8
  • Realtime Subscription Stops Firing After A Few Days
    l

    LewTrn

    08/18/2022, 11:56 AM
    Hi šŸ‘‹ I'm building a web app that uses Supabase Realtime to subscribe to changes the databases within my project. I'm currently on the free tier while I develop this project. I'm subscribed to two tables in my project, replication enabled but no RLS (at least for now while I dev). To start with, everything worked great! I was able to update my tables and see the updates reflected in my localhost app in real time. Then after a few days I noticed that subscriptions suddenly stopped firing. Has anyone else encountered this issue? I created a new Supabase project, pointed to it and subscriptions worked fine. But again, after a few days they stopped firing. Any ideas? Note: I can see the active subscriptions in the subscriptions table under the realtime schema.
    g
    • 2
    • 12
  • withPageAuth user undefined for authenticated user
    l

    lucasb

    08/18/2022, 12:30 PM
    Issue regarding withPageAuth. I have setup a profile page using withPageAuth and the user data is always undefined in the component. I believe this is a bug https://github.com/supabase/auth-helpers/issues/232
    n
    n
    u
    • 4
    • 4
  • Is it better to listen on whole table or with filter?
    t

    theuknowner

    08/18/2022, 12:54 PM
    I have created a chat with Supabase and I have a table named "messages". I have set my security policies, so only if the user is added to conversation can read the messages. So, is it better to listen on whole messages table for new updates/inserts or with a filter eg. listen to messages where conversation_id = 5? In first implementation I'll have 1 listener for the user, If i go with the second I'll have listener for each conversation (40-50 listeners)
    g
    • 2
    • 2
  • How to listen for changes and update state?
    m

    Mathiassio

    08/18/2022, 12:54 PM
    I'm would like to listen for changes in the database, and when a specific column has changes with a specific id, then I would like to update the state "role". Here is my current code:
    Copy code
    js
     const { isLoading, user, error } = useUser();
     const [role, setRole] = useState(null);
    
      async function fetchRole() {
        const data = await supabaseClient
          .from("roles")
          .select("role")
          .eq("id", user?.id)
          .single();
        setRole(data?.data?.role);
      }
    
      useEffect(() => {
        fetchRole();
      }, [role]);
    How can I listen for changes in the database and then change the state? I have looked at .subscribe() but I'm not sure how to implement it.
    g
    • 2
    • 1
  • realtime presence
    l

    larryM

    08/18/2022, 1:04 PM
    I see that realtime presence is available within the next branch of realtime-js. Are we able to start using it in project yet? Thanks,
    g
    s
    • 3
    • 3
  • Dashboard invite user
    m

    MaxAryus

    08/18/2022, 1:06 PM
    I would like to add a second user to my Supabase dashboard at app.supabase.com is there a way to do so?
    s
    • 2
    • 2
  • Does Supabase store locally in case of network outage?
    t

    tembo

    08/18/2022, 4:10 PM
    I have a point of sale desktop app that will be used in places where network may be shaky at times. Does Supabase store locally automatically without local hosting?
    p
    s
    • 3
    • 6
  • Prisma schema auth not exists
    g

    Gruce

    08/18/2022, 4:12 PM
    Hello, I am working on Prisma with Supabase and I have this trigger:
    Copy code
    sql
    CREATE TRIGGER user_created_trigger
        AFTER INSERT ON "auth"."users"
        FOR EACH ROW
        EXECUTE FUNCTION user_create();
    But it shows:
    Copy code
    Error:
    db error: ERROR: schema "auth" does not exist
       0: migration_core::state::DevDiagnostic
                 at migration-engine\core\src\state.rs:250
    Thank you
    n
    • 2
    • 6
  • Supabase database unresponsive
    d

    da newb

    08/18/2022, 6:26 PM
    We just had a production issue where our Supabase DB became unresponsive. I was able to make normal postgres queries against the DB but I could not make PostgREST queries or get realtime responses. I fixed this by restarting our database, but wanted to flag for the Supabase team. Our project identifier is gkcraqebrzkpeezbnfby
    s
    • 2
    • 2
  • How to use Notion sign-in with local development setup?
    o

    osener

    08/18/2022, 8:08 PM
    I am using
    supabase start
    to run my local development server. How can I configure Notion as a GoTrue provider? I am currently getting this error:
    {"code":400,"msg":"Unsupported provider: Provider is not enabled"}
    I have seen mentions of "ejecting" or "self hosting" in the docs, but ideally I would like to keep the workflow I have with Supabase CLI (or at least not configure a lot of extra stuff to get where I am).
    p
    • 2
    • 3
  • Enable team members to unpause projects
    m

    martypdx

    08/18/2022, 8:11 PM
    It appears that teams can only have on owner, and only the owner can unpause projects? Is there a way to have more than one team member be able to unpause projects?
    s
    • 2
    • 3
  • HEIC extension
    d

    Deleted User

    08/18/2022, 9:17 PM
    supabase can't heic image ?
    g
    • 2
    • 2
  • Can't turn off email confirmation
    j

    julie

    08/18/2022, 11:16 PM
    I enabled email confirmation and now I can't seem to turn it back off. Notice that the save button is disabled. Any ideas?
    g
    j
    g
    • 4
    • 8
  • Supabase font
    b

    Baron

    08/19/2022, 2:04 AM
    Hi, I'm a fan of the Supabase custom font and I'm wondering if I can use it for a portfolio web application (social media app) that will be using Supabase. Thank you!
  • Duplicate input field
    c

    Crayon

    08/19/2022, 2:54 AM
    Found a duplicate input field on the custom SMTP form
    s
    • 2
    • 1
  • nextjs auth redirects when already logged in
    h

    harshcut

    08/19/2022, 5:00 AM
    how to redirect to
    /u/dashboard
    (protected page) with
    @supabase/auth-helpers-nextjs
    when user is already logged in?
    Copy code
    ts
    // login.tsx
    export const getServerSideProps: GetServerSideProps = async (context) => {
      return { props: {} }
    }
    • 1
    • 1
  • Can't successfully authenticate with Supabase?
    b

    brianh

    08/19/2022, 5:44 AM
    HI, i've had an existing account for several months with two projects (one of which is in production). Today I noticed issues where nothing happened when I click
    Sign In with Github
    on supabase.com. Strangely, it sometimes lets into the dashboard but its completely empty (no projects to be seen). Also when I click any tab in the navbar it automatically logs me out. Big issue here is I can't access my production app but its still running
    s
    • 2
    • 2
  • How to query data using a join table?
    l

    laubonghaudoi

    08/19/2022, 6:17 AM
    The official doc doesn't provide any examples in querying using a join table: https://supabase.com/docs/reference/javascript/select#query-foreign-tables So I have two tables
    product
    and
    user
    which have many-to-many mapping relationship, and I have a third join table
    product_user
    which has three fields:
    id
    ,
    product_id
    and
    user_id
    . How do I get all products that belong to a certain user in javascript? I found the same issue here: https://github.com/supabase/supabase/discussions/1080 It says it was a limitation in 2021 and we can only do client-side filtering, what about now?
    t
    u
    g
    • 4
    • 10
  • Edge functions Websocket support?
    b

    blank

    08/19/2022, 6:17 AM
    I'm on the fence with using Supabase but stuck on one thing missing; I need to use Websockets and would love to use Edge functions to do it. I understand the reasons for the
    POST
    only restriction, however it prevents
    Connection: Upgrade
    as only
    GET
    is supported https://www.rfc-editor.org/rfc/rfc6455#page-17. Are there any plans to relax the restrictions to allow Websocket connections, or is this already supported and I'm unaware?
    p
    a
    g
    • 4
    • 19
  • Is there a way to specify where `config.toml` file is located at when running `supabase init`
    m

    Migu

    08/19/2022, 6:34 AM
    Title has pretty much the entire question; I wanted to know if it was possible to use a different path than
    supabase/config.toml
    when I run
    supabase init
    or
    supabase start
    ? I'm running it in a Turborepo and I just want to avoid the path
    apps/supabase/supabase/config.toml
    if I can :p Thanks!
  • Error when invoking `signInWithOtp` method on `auth` property of supabase client
    s

    shtepa

    08/19/2022, 7:27 AM
    I am going through nextjs+supabase quick start guide and got stuck with signing in. In the guide it says after instantiating supabase client
    signInWithOtp
    method would be available for signing in but when I use it I get an error saying that there is no function as
    signInWithOtp
    exists on
    auth
    property of supabase client. Full error look as
    _utils_supabaseClient__WEBPACK_IMPORTED_MODULE_3__.supabase.auth.signInWithOtp is not a function
    .Has anyone else come across this issue?
    p
    • 2
    • 19
  • How to correctly set React API URL env variable for Self hosted
    b

    Brice Joosten

    08/19/2022, 9:32 AM
    Hello, I'm self hosting Supabase with Docker, using React as Front-End and I got to observe that communicating with the project's API works fine when it's the online Supabase app, however, not working fine when it's the self hosted one. What I'm trying to do on the client app is basic magic link authentication. However, with self hosted API URL in .env, when submitting form, it will only throw me error alert popup ("Error sending confirmation mail"). I've tried to observe and compare differences between my online API and the local API. The "supabase.co" root API URL (no endpoint) returns plain JSON saying "No API key found in request" (which I send when creating the supabaseClient in React so at least, I can figure out that the root URL with no endpoint is the right one. However, when I do the same thing with the local API, it only returns plain JSON saying "No Route matched with those value" and at first I thought the problem was that the root URL with no endpoint of both remote and local API are differents and so I found out that the local API's endpoint "/rest/v1" returns HTML content saying "Kong Error - No API key found in request". Of course, when I try to set the local React API URL .env variable with the "/rest/v1" part, submitting form doesn't work and only throws me error alert popup ("Content-Type not acceptable: text/plain"). So my question is : what am I doing wrong ? Is there something I missed ? I really don't understand to this point. I've readen a lot of Github issues topics more or less related to self hosted version and generally, it invites me to read the Self hosted documentation which, in my case for this issue, isn't very informative because no further documentation about self hosted env variable React side... Thanks a lot if you've readen this far. ***Edit ***: I feel like that if there should be informations about React .env variables in documentation it should be there but it isn't : https://supabase.com/docs/guides/with-react .
  • How to get JWT in Next.js ssr
    u

    0xAvneesh

    08/19/2022, 9:53 AM
    Hey everyone, how can I get the jwt token from supabase on the Next.js server?
    d
    • 2
    • 2
1...456...230Latest