Supabase is an open source Firebase alternative
Questions tagged [supabase-js]
74 questions
14
votes
1 answer
Module not found: Can't resolve 'encoding' in '/vercel/path0/node_modules/cross-fetch/node_modules/node-fetch/lib'
Has anyone come across this non-breaking warning issue that you get with the npm package: @supabase/supabase-js
The warning message:
warn - ./node_modules/cross-fetch/node_modules/node-fetch/lib/index.js
Module not found: Can't resolve 'encoding'…

Max Silva
- 477
- 1
- 7
- 15
5
votes
4 answers
Next.js 12 + Supabase project error "No storage option exists to persist the session"
I am working on a project using Supabase and Next.js 12.3.4, and I have set up Google sign in using this tutorial: Supabase Login with Google. When I run the project, Terminal repeatedly warns
No storage option exists to persist the session, which…

esd
- 63
- 1
- 4
4
votes
0 answers
Supabase "TypeError: fetch failed"
I am making a to-do list application with Supabase and NextJS-13 and while fetching the lists from Supabase, the server gave me this error
Error Image
My List table on Supabase has three columns:
id
created_at
list_name
Supabase generates the…

Vaibhav Jain
- 51
- 4
2
votes
1 answer
Supabase reset password error: "Auth Session Missing"
The following function fails with error "Auth Session Missing"
const { error } = await supabase.auth.updateUser({
password: password,
});
After getting the reset password link on my mail i redirect the user to '/reset' link.
The link i get look…

Deep Shetye
- 143
- 1
- 7
2
votes
1 answer
Supabase update with incrementing value
I am using supabase-js and have a table like this:
userID: string
timesVisited: number
eventName: string
I am using update like this:
Admin.from(tableName).update([{userID,eventName,timesVisited}])
Currently I have to make two calls one to get…

Shivam Sahil
- 4,055
- 3
- 31
- 62
2
votes
2 answers
Supabase Realtime detecting duplicates for the same event
I have a simple page where I'm inserting a message into a message table and then on the frontend detecting it. I have used the sample code provided.
However, everytime, I seem to be detecting 3 events for every insert.
Any ideas?
mounted() {
…

Saumil Shah
- 1,383
- 2
- 11
- 20
2
votes
1 answer
How to escape string characters in supabase js OR query?
I'm trying to write a query that matches rows where a user-provided string matches one of two text array columns.
For example, imagine a table messages with text columns greeting and goodbye:
// WORKS
const greeting = 'Hello there'
const goodbye =…

Sam Pierce Lolla
- 219
- 1
- 8
2
votes
0 answers
How can I get the image that OpenAI API returns and upload it to Supabase Storage?
I tried using the URL that is returned by default but there is a CORS issue on OpenAI's end which won't allow me to use fetch. So now I am trying to use b64_json but I cannot figure out how to get that in a format that can be uploaded. Everything I…

Globe
- 169
- 11
1
vote
0 answers
Unable to Update first_name and last_name Columns in public.profiles Table Using Supabase (React Native)
I'm working on a project that uses Supabase as the backend, and I've set up a public.profiles table to store user profile information. The table structure looks like this:
create table
public.profiles (
id uuid not null,
first_name text…

Owen
- 21
- 2
1
vote
1 answer
Multiple join in Supabase JS
I have 3 tables in supabase.
Message --> with foreign key 'request_id' to table Product_Request
Product_Request --> with foreign key 'product_id' to table Product
Product
How can i select all messages data with info from the others table?
I tried…

vmaltarello
- 11
- 4
1
vote
1 answer
Typescript incorrectly infers supabase select results
Supabase table declarations:
create table public.profiles(
id uuid unique references auth.users on delete cascade,
full_name text,
updated_at timestamp with time zone default now() not null,
created_at timestamp with time zone…

Martin
- 411
- 8
- 21
1
vote
1 answer
Supabase trigger function works differently via client than direct manipulation does
I have a trigger function that runs after insert/delete on a table, but seems it's only working as expected when i add rows directly into the DB in supabase console, but when I do inserts/deletions via the supabase js client, it behaves differently,…

Redgren Grumbholdt
- 1,115
- 1
- 19
- 36
1
vote
0 answers
Creating new table in Supabase client side?
I am trying to create a supabase table client side using RPC.
I have setup a function in supabase to be called when RPC is invoked.
Where I pass an table name client side in Next.js with pages router.
BEGIN
EXECUTE 'CREATE TABLE ' ||…

Aleksa_97
- 21
- 3
1
vote
1 answer
supabase select on nested entity
I am using Supabase and can use the client to retrieve nested data. However, I cannot work out how to select WHERE an Id matches a foreign key on the top level select.
Here is the query:
const {data} = await client
.from("teacherclasses")
…

grayson
- 945
- 1
- 11
- 28
1
vote
1 answer
Is there a better way to access Supabase generated TS types?
I have created a table called customer in my supabase db.
Generated my types using
npx supabase gen types typescript --project-id "$PROJECT_REF" --schema public > types/supabase.ts
In my React app this is how I am referencing the generated…

Null Head
- 2,877
- 13
- 61
- 83