Questions tagged [supabase]
Supabase is a collection of open source tools to build modern applications quickly and efficiently. It uses the PostgreSQL database to power its authentication, database, and storage features. Use this tag when you are having problems, and not to ask for new features.
1,791
questions
4
votes
0
answers
1k
views
405 Method Not Allowed after deployment on vercel (using react app)
I have an app using redwood, supabase and prisma.
I've just deployed it on vercel and now I can't access to my data. I have an error 405 Method Not Allowed, but I don't understand why, as it works ...
4
votes
2
answers
626
views
Upload image after clicking on submit button, not on input change
I want to create a form that uploads the images to Cloudinary and then gets the image's URL and parses it into Supabase database, but I only want to upload the images when I click the Publish button (...
4
votes
0
answers
963
views
Supabase SSR getSession always returns null
I've tried to check for session on server side in my NextJS project. I've used supabaseService client and also "createServerSupabaseClient" from @supabase/auth-helpers-nextjs both of those ...
4
votes
1
answer
248
views
Deno Deploy --cert flag
How can I add --cert flag when my project run on deno deploy?
I am using deno fresh and supabase postgres. When in local environment I use --cert flag to set certificate, but in deno deploy I didn't ...
4
votes
1
answer
6k
views
How to update the password of a Supabase user on a NextJs project?
I'm facing an issue updating a password for a supabase user on a BlitzJs (NextJs) project.
Basically, I have a reset password method that works perfectly. First I send an email with a reset link, that ...
3
votes
1
answer
2k
views
supabase: `prisma migrate dev` sometimes times out (postgres advisory lock)
I have a supabase database (postgres 15.1.0.88) and I'm using prisma as ORM(latest version [email protected]). When trying to apply migrations with prisma migrate dev, the command most of the times ...
3
votes
3
answers
3k
views
How to use Redux RTK Query with Supabase
Does anyone know how to use the Supabase Query pattern combined with RTK Query like for example https://dev.to/sruhleder/using-react-query-with-supabase-a03.
3
votes
2
answers
4k
views
Supabase REST: how to refresh token?
I'm using the supabase api (REST) with SWR. I have almost all endpoints to login, logout, invite, update an user, etc, but I can't find the endpoint to refresh the token.
Anyone knows about this ...
3
votes
4
answers
6k
views
supabase bucket policy to insert file not working
I am trying to insert a file into a supabase public bucket, I've created basic policies to insert, select. when I try to upload a file though it returns
{
statusCode: '401',
error: 'Invalid JWT',
...
3
votes
2
answers
4k
views
Cannot access env variables next.js [duplicate]
I'm creating an app with Next.js and Supabase. When I create the client in /utils/supabase-client.js, it throws the error that Error: supabaseUrl is required..
Here is my file:
import { createClient } ...
3
votes
1
answer
6k
views
Complex query with parameters in SUPABASE
I would like to create this except query in supabase, but with parameters in the day column. For example:
CREATE VIEW employees_without_registering AS
SELECT employees.id
FROM employees
EXCEPT
...
3
votes
1
answer
9k
views
Role based authentication in Supabase
I am trying to make policy in supabase where a user with admin role can only get list of employees whose role are "agent"
There is a "users" table and I am trying to add following ...
3
votes
3
answers
7k
views
Supabase onAuthStateChanged - How do I properly wait for the request to finish prevent flickering with useEffect?
Everything auth-wise is working fine. I even have a loading state setup so that the loader shows until the state is changed, but I still get this flickering on reload. This flickering only happens ...
3
votes
1
answer
206
views
Create recursive view with WHERE clause
I am trying to make a view for my recursive query, and use the view with a where clause to set a starting point.
CREATE TABLE dog (
id int,
name varchar(50)
)
CREATE TABLE dog_parent (
id ...
3
votes
1
answer
711
views
How to deploy all Supabase edge functions at once?
I have multiple Supabase edge functions I want to deploy simultaneously when I push to production. These are all the functions in my .supabase/functions folder, ie:
.supabase
functions
...
3
votes
1
answer
5k
views
Cannot update Supabase table because it does not have a replica identity
When trying to my first table update using Supabase, with code like:
await db.from("welcome").update({visit_count: newCount});
Got error:
{
"hint":"To enable updating the ...
3
votes
2
answers
4k
views
uploading a file on supabase: error RequestInit: duplex option is required when sending a body
I'm trying upload a file on supabase with node.js and I get this error:
RequestInit: duplex option is required when sending a body. I don't konw what it means. What am I doing wrong in my code?
router....
3
votes
1
answer
449
views
Using supabase.auth.getSession() is potentially insecure
I am using Supabase in my Next.js application.
I have initialised Supabase as shown below. This process is even mentioned in their official documentation.
utils/supabase/server.js
'use server'
import ...
3
votes
2
answers
2k
views
Can't reach database server at `aws-0-us-east-1.pooler.supabase.com`:`5432`
Happy Monday! I've recently run into a weird issue and can't seem to figure out what would be causing it.
I have a NextJS project using Prisma and Supabase. When I run the app on my Windows desktop or ...
3
votes
1
answer
694
views
Best practice for integrating clerk with supabase
I came up with my custom react hook for handling supabase, I don't know if using this hook everywhere would be the best practice as I have to deal with isLoading every time when I use it.
import { ...
3
votes
2
answers
233
views
Supabase puts certain rows at the top
My Supabase JS client performs an INSERT on the messages table using the following.
import { createClient } from "@supabase/supabase-js";
const supabase = createClient(
"MY ...
3
votes
1
answer
1k
views
How to execute async code before redirect on vue-router?
I'm building a app with supabase. I have a route that receives query parameters from a email magic link and I want to validate those parameters on supabase service before I redirect to a target url (...
3
votes
1
answer
2k
views
How to add Supabase Order by in get request using Postman
I need to add order in supabase result while calling the supabase bash in postman.
I am doing same in flutter like below
Future getPropertiesFromBirmingham() async {
var response = await client
...
3
votes
1
answer
2k
views
NextJs + supabase not deploying supabaseUrl is required
i'm trying to deploy my project but i keep getting this error saying that supabaseUrl is required.
I'm getting this error
This is my supabaseClient.js
import { createClient } from "@supabase/...
3
votes
1
answer
3k
views
AuthRetryableFetchError with Supabase Auth
I've recently rewritten parts of my Supabase webapp, but something started to crash. When I call handleSignIn with the form on my site it refreshes (obviously no session is set nor any user is logged ...
3
votes
2
answers
535
views
extending nested interface generated by supabase
I have the following Typescript interface generated by Supabase
export interface definitions {
Users: {
/** Format: uuid */
id: string;
/**
* Format: timestamp with time zone
...
3
votes
1
answer
876
views
Supabase and Google Apps Script
Is it possible to use Supabase with Google Apps Script (GAS)?
I'm new to Supabase and I've never tried to import external library to GAS before. I'm planning to use Supabase as a database for my ...
3
votes
1
answer
4k
views
Nuxt.js3 plugin's context becomes undefined
I am developing an application using Nuxt.js3 and supabase.
Nuxt.js in plugins/supabase.server.js (I haven't figured out if server or client is better for this too.) I want to use "supabase = ...
3
votes
1
answer
682
views
Query a timestamp range in supabase
I have a table in my supabase database with two columns start end end. Both are of type timestampz. Now I want to query all entries where the current timestamp (Date.now()) is inbetween start and end.
...
3
votes
2
answers
168
views
Input type hidden value not being recognized when deployed on vercel
Whenever, I try to update the data on Vercel, this is the error that it shows:
invalid input syntax for type uuid: "undefined" - unable to save
However, it successfully updates the data ...
3
votes
1
answer
1k
views
Error using Next.js13 and Next/Supabase auth
Once I do the login this problem appears :
Failed to parse cookie string: [Error: The edge runtime does not support Node.js 'buffer' module.
Learn More: https://nextjs.org/docs/messages/node-module-in-...
3
votes
2
answers
781
views
What's the equivalent of this Supabase query in SQL ( Postgresql )
I have a table "store" and a table "product". Each store has multiple products but a product only has one store ( one to many relationship ). The tables might look something like:
...
3
votes
2
answers
2k
views
How to reset the auto incremented id column to 1 whenever I seed the database in postgreSQL?
I am using Supabase as a backend which provides postgres as its database and prisma for my next-js app. I wanted to seed some dummy data into the database. The first time I run the seed script, ...
3
votes
2
answers
2k
views
Can't insert into table with RLS despite being logged in?
I want to add a row to a profiles table in the public schema immediately after the user has signed up and their auth user has been created in the database.
The user gets created successfully, and I ...
3
votes
1
answer
4k
views
How to handle redirect from supabase signin?
I was hoping someone would show me how to handle redirect (to dashboard page) in supabase. Here below is a sample of my code (the issue is I would like to redirect to an account page after ...
3
votes
1
answer
722
views
Using Google Oauth with supabase, can't login with different account
I am using supabase Oauth Google provider in one of my projects, after the initial login with one of my accounts, when i logout and try to login again using google, it uses the same old account to ...
3
votes
1
answer
733
views
How to make a boolean form input in supabase using nextjs server actions?
I am trying to make a form to submit data to supabase (with nextjs 13).
I can submit a string input. I am trying to add a boolean field.
I have commented out the 'published' fields in this form. If I ...
3
votes
2
answers
797
views
Supabase join returning 1 object instead of list of objects
I am trying to query my posts table for a post, which contains the user's user_id and I want to join it with the profiles table using the user_id.
post table schema: (post_id: uuid, created_at: ...
3
votes
1
answer
326
views
Manage Supabase as an infrastructure-as-a-code for version control
I want to be able to manage my Supabase project as a code, with regards to the SQL tables, the functions, auth, et cetera.
The purpose is to allow myself to version control the project.
I have gone ...
3
votes
2
answers
1k
views
How to modify a Supabase table from the dashboard UI or the Supabase SQL editor?
Whenever I try to modify an existing table in the Supabase dashboard, I get this error "Failed to pg.columns: must be owner of table <table_name>". This seems to be like a permission ...
3
votes
1
answer
939
views
Can't update an image from the bucket
I've been trying to update a single file within a folder in the bucket that i created but when i go to update with a new image from the front does not update the image and gives the following error.
...
3
votes
1
answer
395
views
Dynamic social sharing cards populated in <svelte:head>
I've built a blog website and am trying to implement dynamic social share cards for each individual blog. While everything appears to be working properly when I inspect the head element in developer ...
3
votes
2
answers
2k
views
Deno import_map.json for supabase
I try to work with supabase edge functions in a Deno environment in IntelliJ Ultimate.
The corresponding plugin is already installed but inside my supabase folder the functions I wanna create do not ...
3
votes
1
answer
1k
views
How to link a storage bucket file into an item in a table
How can I link a file in my storage bucket into a table?
Let's say I have an item like this
Name: user, CreatedAt: date, pfp: storageFile
I want the file to be linked to the pfp field.
3
votes
1
answer
2k
views
supabase: how to reference files within tables
I want my users to be able to upload reports (PDFs). For this purpose, I have created a table of "reports" and thought that I can reference the object stored there. Therefore I created a ...
3
votes
1
answer
1k
views
Supabase Self hosting issue
I am trying to host Supabase with a separate PostgreSQL DB. According to their docs, they say that Supabase uses pgjwt for auth. However, AWS RDS or Azure PosrgreSQL doesnt not support pgjwt.
Is ...
3
votes
1
answer
123
views
Act on Behalf of GitHub User With Supabase Auth
I have a JavaScript browser app, and a ASP .NET Core Minimal API backend. The database is Supabase and the user authenticates with the GitHub Supabase auth provider.
The app, whether backend or ...
3
votes
0
answers
375
views
supabase "TypeError: fetch failed" using next.js
I am trying to make a request to nextjs route handler where I am using supabase database to retreive some rows from a particular database table. The table exist and it is already filled with rows. ...
3
votes
2
answers
470
views
Next Js with Supabase Failed to compile
I created a project with Next.js and Supabase, and everything was running smoothly. However, after adding a table and generating TypeScript Definitions from the PostgreSQL schema using Supabase CLI, I ...
3
votes
0
answers
342
views
ReferenceError: window is not defined in React Native project after adding Supabase call
I'm using a React Native project with Expo v49, and I added a Supabase call to read some data from the database, and it works on ios/android,
But when I open the web version, I get "...