Lovable Form Data Not Saving to Supabase
Quick Answer
Either RLS (Row Level Security) is blocking inserts, the Supabase connection isn't properly configured, or the table schema doesn't match what the form sends. Start with "Check RLS in Supabase" before making broader code changes.
You're in the right place if...
- !Form submits successfully but data doesn't appear in Supabase
- !Supabase table is empty
- !No error shown to user
Why this happens
Either RLS (Row Level Security) is blocking inserts, the Supabase connection isn't properly configured, or the table schema doesn't match what the form sends.
Fix
Check RLS in Supabase
Go to Supabase Dashboard → Table Editor → your table → click the shield icon for RLS policies. If RLS is enabled with no policies, ALL inserts are silently blocked.
Temporarily disable RLS to test
Run this in Supabase SQL Editor to confirm RLS is the problem:
-- Run in Supabase SQL Editor -- TEMPORARY: disable RLS to test ALTER TABLE your_table_name DISABLE ROW LEVEL SECURITY; -- After confirming it works, re-enable -- and add proper policy instead
Tell Lovable to fix it
Ask Lovable to add proper RLS policies:
Copy this prompt
The contact form data is not saving to Supabase. Please check the RLS policies on the leads table and add a policy that allows anonymous inserts.
Prevent this next time
When connecting Supabase, always tell Lovable: 'Add RLS policies that allow the form to insert data for anonymous users.'
Frequently Asked Questions
Row Level Security. It controls who can read and write data. When enabled without policies, it blocks everything by default.
Only for testing. In production, add proper policies instead. Lovable can generate these for you.
Related fixes
Weekly Newsletter
Get next week's fix before you need it.
Join developers getting weekly vibe coding tips, error fixes, and tool updates.
Subscribe on Substack →