Edge Functions, webhooks and API guides
The server side of an app: Edge Functions, CORS, incoming webhooks, database webhooks, scheduled jobs and rate limits. What each error means and the fix that holds in production.
- Supabase Edge Function returns 404 NOT_FOUND on the CORS preflightThe OPTIONS request to your Supabase Edge Function returns 404 NOT_FOUND and the browser reports CORS. Your CORS code never ran: how to find the real cause.
- Supabase Edge Function 401 “Invalid JWT” or “Missing authorization header”Why a Supabase Edge Function returns 401 'Invalid JWT' or 'Missing authorization header' before your code runs, and the fix for browsers, webhooks and cron.
- Supabase Edge Function CORS errors from the browser – headers, preflight and error responsesFix 'Request header field x-client-info is not allowed by Access-Control-Allow-Headers' and other CORS errors when calling Supabase Edge Functions.
- Supabase cron (pg_cron) job not running – a checklist with the SQL for each stepYour Supabase cron job never runs or runs but does nothing. Check cron.job, job_run_details, the scheduler, UTC times and pg_net calls, with SQL.
- Supabase Database Webhooks and pg_net requests that never arrive – how to debug themSupabase Database Webhook or pg_net call not reaching your Edge Function? Read net._http_response, fix 401s and timeouts, and handle missed events.
- Stripe “No signatures found matching the expected signature for payload” – raw body and the right secretFix Stripe 'No signatures found matching the expected signature for payload' in Next.js, Express and Supabase Edge Functions: raw body, right secret, async.
- Rate limiting an API route – return 429 Too Many Requests before abuse costs youAdd rate limiting to a Next.js route, Express API or Supabase Edge Function: a Postgres fixed-window counter or Upstash Redis, 429 and Retry-After.
- CORS “must not be the wildcard '*' when the request's credentials mode is 'include'” – the safe fixFix the CORS error 'Access-Control-Allow-Origin must not be the wildcard * when the request's credentials mode is include' without opening your API.