---
title: "Discussion on \"Fix Supabase \"Cannot coerce the result to a single JSON object\" (PGRST116)\" | Hashnode"
description: "Discussion on \"Fix Supabase \"Cannot coerce the result to a single JSON object\" (PGRST116)\". Why .single() returns PGRST116 with 0 or 2+ rows in Lovable, Bolt and Vite apps: missing rows, RLS, updates, non-unique filters, and the fix"
url: "https://hashnode.com/posts/supabase-single-pgrst116-cannot-coerce-single-json-object/6afb271adc3680d475285109"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Fix Supabase "Cannot coerce the result to a single JSON object" (PGRST116)](https://stacksmesh.hashnode.dev/supabase-single-pgrst116-cannot-coerce-single-json-object?utm_source=hashnode&utm_medium=feed)

Why .single() returns PGRST116 with 0 or 2+ rows in Lovable, Bolt and Vite apps: missing rows, RLS, updates, non-unique filters, and the fix

2d ago · 7 min read · stacksmesh.hashnode.dev  
Read the article

-   [#supabase](https://hashnode.com/tag/supabase)
-   [#webdev](https://hashnode.com/tag/webdev)
-   [#react](https://hashnode.com/tag/react)
-   [#postgres](https://hashnode.com/tag/postgres)

## Written by

[Ahmed Hassan Yaseen](https://hashnode.com/@ahmedhassanyaseen)

@ahmedhassanyaseen

  
[View profile](https://hashnode.com/@ahmedhassanyaseen)

Founder of StacksMesh. I make AI-built apps production-ready.

Founder and CEO of StacksMesh (stacksmesh.com). We fix, launch and migrate apps built with Base44, Lovable, Bolt and Replit, with a fixed price in writing before any work. I write about making AI-built apps safe and production-ready.

## Responses 1

Markdown supported · ⌘↵ to post

[Tarun Sharma](https://hashnode.com/@101beardo)

[8h ago](https://hashnode.com/posts/supabase-single-pgrst116-cannot-coerce-single-json-object/6afb271adc3680d475285109/comment/6afdf0c924b1265a24594862)

Worth branching on error.details too, since PostgREST says how many rows it saw: "The result contains 0 rows" points at a missing row or an RLS policy hiding it, while 2 or more rows means a missing unique constraint, and those are different fixes. Also maybeSingle() is the better call when zero rows is a normal outcome, like a profile lookup before the user has saved anything.
