© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•13mo ago•
13 replies
Mario

Database error with local edge functions

Hi there,

I'm kind of new to all this, so apologies if there are things that are super obvious to a proper SWE.

I have a project that uses edge functions to store information in my supabase database and storage. That works as intended in my production setting. However, when I try to do this locally, it fails.

What I've done and tested:
- I adjusted the .env variables accordingly and checked with logging that this is correctly setup
- when using a curl request, I actually can connect to my local database as intended
- the local database has the exact same schema as the remote database
- I run npm run dev & supabase functions serve --env-file ./supabase/functions/.env --no-verify-jwt --debug | cat
- When I run my edge function, that is supposed to insert something into a database, I get this error:
[Error] Database error: {
message: "TypeError: error sending request for url (http://localhost:54321/rest/v1/image_generations?select=*)",
details: "TypeError: error sending request for url (http://localhost:54321/rest/v1/image_generations?select=*)\n" +
" at async mainFetch (ext:deno_fetch/26_fetch.js:170:12)\n" +
" at async fetch (ext:deno_fetch/26_fetch.js:391:7)\n" +
" at async Server.<anonymous> (file:///Users/marioottmann/Coding/magicdoodles/supabase/functions/store-generation-metadata/index.ts:36:29)\n" +
" at async #respond (https://deno.land/std@0.208.0/http/server.ts:224:18)",
hint: "",
code: ""
}

I test via both frontend and: curl -i --location --request POST 'http://127.0.0.1:54321/functions/v1/store-generation-metadata' --header 'Content-Type: application/json' --data-raw '{"userId": "00000000-0000-0000-0000-000000000000","preprompt": "test preprompt","prompt": "test prompt","imageUrl": "https://test-image-url.com/image.png"}' | cat
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Database Functions vs Edge Functions
SupabaseSSupabase / help-and-questions
5mo ago
Call Edge Functions from Database Functions
SupabaseSSupabase / help-and-questions
7mo ago
Edge functions error
SupabaseSSupabase / help-and-questions
3y ago
Authorization for Local Edge Functions
SupabaseSSupabase / help-and-questions
2w ago