Guides

Supabase form says "Saved!" but nothing is saved: how to fix it

Updated November 25, 2026 · by Valmir, founder of Publishub

Short answer

supabase-js doesn't throw when an insert fails: it returns an error object, and if the code ignores it, the app shows "Saved!" anyway. The most common cause is row-level security (RLS): the table has RLS enabled but no policy that allows this user to insert, so Postgres rejects the row with "new row violates row-level security policy". Check the error, add an insert policy, and read the data back to confirm.

Step 1: stop ignoring the error

  1. 01Look at what the insert returns

    Every Supabase call returns { data, error }. Show the error instead of the success message when it's set. AI-generated code often skips this check.

    const { error } = await supabase.from("notes").insert({ title, user_id: user.id });
    if (error) {
      console.error(error);
      showError("Couldn't save. Please try again.");
      return;
    }
    showSuccess("Saved!");
  2. 02Read the message

    Open the browser console and the Network tab, save again and look at the failed request. The error message tells you which of the causes below you have.

Step 2: fix the cause

  1. 01"new row violates row-level security policy" (RLS)

    RLS is on and no policy allows the insert. Add one that lets logged-in users insert rows they own, in the Supabase SQL editor:

    create policy "Users can insert their own notes"
    on public.notes for insert
    to authenticated
    with check (auth.uid() = user_id);
  2. 02The insert works but data comes back empty

    If the code calls .insert(...).select() and there's no select policy, the row is saved but can't be read back. Add a matching policy for select (using (auth.uid() = user_id)).

  3. 03"Could not find the column"

    The code sends a field name the table doesn't have, often after the AI renamed something on one side only. Make the names match the table in Supabase's Table Editor.

  4. 04The user isn't logged in

    With RLS, a request without a session runs as the anon role and fails policies meant for authenticated users. Check that the session exists before saving.

Step 3: prove it saved

After the fix, save something, reload the page and confirm it's still there, or check the table in Supabase. Then test with a second account: it should not see the first account's rows. That last check catches the opposite mistake, a policy so open that everyone can read everything.

To catch this automatically after every change, run a journey that saves something and reads it back. stillworks, a free open-source tool, has a ready-made "read the data back" recipe for exactly this case.

Free tool · No signup

Check your app now, in about a minute

Paste your app's URL. We open it in a real browser and show JavaScript crashes, failed requests and broken pages. Read-only: we never log in or submit forms.

Free · No signup · Read-only: we never log in, submit forms or change anything

Questions

Should I just disable RLS to make it work?
No. Without RLS, anyone with your public anon key can read and change every row in that table. Keep RLS on and add policies that allow exactly what each user needs.
Why does it work in the Supabase dashboard but not in my app?
The dashboard's SQL editor runs with full privileges and skips RLS. Your app runs as the logged-in user (or anon), so the policies apply.

Stop checking by hand after every AI change

Publishub is building the full version: your sign-up, login and checkout journeys, run in a real browser after every deploy and compared with the last version that worked. It's in development; the waitlist is open.