Edge function secret issue

I have an Edge Function (parse-car-text) that returns a 500 error saying: "GEMINI_API_KEY is not configured", but the GEMINI_API_KEY is listed in my Project Secrets. I need help verifying why the function runtime is not seeing the secret. What I have already done: Confirmed GEMINI_API_KEY appears in Project → Settings → Secrets.
18 Replies
tomaspozo
tomaspozo4d ago
can you share your full function code? Missing the Deno.env.get Also, can you share a screenshot of Confirmed GEMINI_API_KEY appears in Project → Settings → Secrets. secrets in Supabase are set under Edge Functions > Secrets: https://supabase.com/dashboard/project/_/functions/secrets
Zeruxe
ZeruxeOP4d ago
now im having a bit of a different problem let me show you I run that I have the secrets I have evrything set up but the logs in the function shows me this
silentworks
silentworks4d ago
Try running that on your computer locally outside of an edge function and see what results you get.
Zeruxe
ZeruxeOP4d ago
Let me just clarify, im basically trying to host my loveable project myself, so im trying to replicate this file
tomaspozo
tomaspozo4d ago
I see, are you sure this works with GEMINI api? const contentText = data?.contents?.[0]?.parts?.[0]?.text; Maybe try adding a console.log of data prior to this line, so you see what data contains
Zeruxe
ZeruxeOP4d ago
Yes loveable uses gemini api 2.5 flash and it works perfectly besides its also free so I just made an account and made my own api
tomaspozo
tomaspozo4d ago
because it looks like this is the line that errors:
if (!contentText) throw new Error("No textual content found in Gemini response");
if (!contentText) throw new Error("No textual content found in Gemini response");
so nothing is being set to contentText
Zeruxe
ZeruxeOP4d ago
where exactly
tomaspozo
tomaspozo4d ago
on your edge function code, before const contentText = data?.contents?.[0]?.parts?.[0]?.text;
Zeruxe
ZeruxeOP4d ago
hold on I need to install deno first no ? if im gonna run this locally ok that problem is fixed perfect Now one of my 2 edge functions that use resend api doesnt show any logs is it because im on supabase free tier? I have 3 edge functions total
tomaspozo
tomaspozo4d ago
free tier is enough for this can you share your code?
Zeruxe
ZeruxeOP4d ago
dont you worry brother I have cooked a long way now im having vercel problems well im trying to remove the preview image For some reason it still says loveable assuming it was a problem with the metadata but I have changed it but it still says loveable
tomaspozo
tomaspozo4d ago
You can google search a solution for this... looks like you need to add manually some tags:
No description
tomaspozo
tomaspozo4d ago
<meta property="og:title" content="My Awesome React App" />
<meta property="og:description" content="A description of my awesome React app." />
<meta property="og:image" content="/path/to/your/og-image.jpg" />
<meta property="og:url" content="https://yourwebsite.com" />
<meta property="og:type" content="website" />
<meta property="og:title" content="My Awesome React App" />
<meta property="og:description" content="A description of my awesome React app." />
<meta property="og:image" content="/path/to/your/og-image.jpg" />
<meta property="og:url" content="https://yourwebsite.com" />
<meta property="og:type" content="website" />
in your index.html file probably when you handle the hosting with lovable, it implements this internally
Zeruxe
ZeruxeOP3d ago
You you’re right Apparently there is a lazy cache scraping preview mechanism So even if I fix the code the image in discord will still show the old one because it is lazy and cached it So to force it to update you gotta scrape it using facebooks tool https: // developers.facebook.com/tools/debug/ Because then it forces like discord to cache it again Never heard that before But makes sense ig I also ran into a few things, im kinda new to supabase. I noticed it was yelling about RLS on my user accounts. If I enable it. Then it breaks the login if I dont then it yells at me saying to enable it Do you know what might cause it and if its really needed? I mean for this case there is just 1 user and thats to upload the cars so idk if its needed
tomaspozo
tomaspozo3d ago
You will need to share more information: exact error you are getting, explain exactly when it happens, if an RLS issues, your current policies… I recommend to create a new post, with the title: RLS issues, and the descriptions I mentioned So more folks can jump in
Zeruxe
ZeruxeOP2d ago
I mean it works when I disabled it It just said RLC policy error on supa
garyaustin
garyaustin2d ago
As asked, you should start a new post. Provide detail on what operation is getting an RLS error. What table? What policies? From the REST API, an auth call,the dashboard UI?

Did you find this page helpful?