400 bad request
Im getting an 400 bad request error whilst trying to use supabase in my code
index.js:1
GET https://wqwvralnrvdqpoemfbaw.supabase.co/rest/v1/contracts?select=contract_id&order=contract_id.desc&limit=1 400 (Bad Request)
(anonymous) @ index.js:1
(anonymous) @ index.js:1
i @ index.js:1
Promise.then
u @ index.js:1 (anonymous) @ index.js:1 I @ index.js:1 (anonymous) @ index.js:1 then @ wrapper.mjs:1
u @ index.js:1 (anonymous) @ index.js:1 I @ index.js:1 (anonymous) @ index.js:1 then @ wrapper.mjs:1


34 Replies
You need to enable RLS to use supabase on the client
ah, where do i enable that?
On the tables
do i need to add any policies?
im still getting the same error though after adding read, insert, delete and update access to all users in all 3

Your error is not RLS. You don't have RLS enabled so no requests will be blocked.
alright. what else could be causing this error then? could be the url perhapsm but since im working with html and js i cant use
postgresql
Also RLS is a permission error or no data.
Are you using supabase-js?
should be yes
What is your supabase-js code that is doing this select?
You should be logging out error with your request to see if there is more info.
Also check the Dashboard API Gateway log and see if the request gets there and there is more error info.
you shared ur ip
i mean if anyone wanna do anything with it sure
i guess i could edit it out
I think it is saying your apikey is bad/wrong.
this is the stuff related to creating
Contracts
this is the key to use?

yea maybe read the doc
asking doesnt mean i havent, i could read something, yet understand it wrong
What error do you get back ?
how did you write all that code if supabase did not work @YesMan
copilot
oh ok
I may be wrong on the apikey I saw invalid in the log for apikey but it actually invalid:null so I guess that is valid... LOL
It is getting the anon role it seems.
ye it is, supabase-js doesnt have cookie
must use supabase/ssr
I don't see any reason in the log for the 400 or what it is about.
If error from the js supabase call does not have anymore info sort of stuck at the moment.
Is your instance status good on the main page?

i managed to fix the other error
although now im getthing this errors spammed
which is in short
Could not fetch contracts. Check database permissions (RLS) and network connection.
its just this 100 times a second
Error fetching settings: {message: 'TypeError: Failed to fetch', details: 'TypeError: Failed to fetch
at https://cd…r.net/npm/@supabase/supabase-js/+esm:7:3141)', hint: '', code: ''}
index.html:1230
No debugger available, can not send 'variables'
You are in a loop
Your code is.

Are you retrying if you get an error?
its calculateClientData
just copy paste the example if the documentation and see it that works at least
does seem to work now after fixing the save loop

it now only saves when need to aswell instead of like X ms
xd
im getting this though so will have to check on that
Could not read source map for https://cdn.jsdelivr.net/npm/chart.js: Unexpected 404 response from https://cdn.jsdelivr.net/npm/chart.umd.min.js.map: Failed to resolve the requested file.