ErrorsPostgREST
PGRST116
You asked for exactly one row and got none (or several)
The query used `.single()`, which promises the database will return exactly one row. It returned zero rows, or more than one, so the request fails rather than guessing which you meant.
In an AI-built app, specifically
Almost always zero rows rather than several — and almost always because row-level security filtered them out, not because the data is missing. The row exists, the query is correct, and the policy decided this visitor may not see it. The same query run in the Supabase SQL editor returns the row, which is what makes this one so confusing.
What it is not: Not a bug in your query syntax. A malformed query gives you a parse error, not this.
How to fix it
- 01Run the same query in the Supabase SQL editor. If the row comes back there but not in your app, this is a policy problem rather than a data problem.
- 02Check that a SELECT policy exists on the table and that it matches how your app signs people in — a policy written for an authenticated user returns nothing to a visitor the database treats as anonymous.
- 03If zero rows is a legitimate outcome — a lookup that may genuinely find nothing — use `.maybeSingle()` instead, which returns null rather than erroring.
If the steps did not do it
An error is one symptom, and the cause is often somewhere else entirely. The broken-app check reads your published site and looks at everything at once — and if it cannot tell either, connecting your repository is what lets Refinar read the code and fix it.