Category

Supabase

Explore our curated collection of articles, insights, and stories about Supabase.

74 Articles
Supabase

Fix Supabase: Invalid Refresh Token Already Used

Trace which client retains an old Supabase token, preserve refreshed response cookies, and let the affected browser sign in again without a global logout.

9 min read
Supabase

Fix "c(...) is not a function" on Firebase SSR deploy

A Stack Overflow question with 14 votes and no accepted answer, and the GitHub issue the same reporter filed a month later with minification turned off. Together they show exactly which import fails, and that this bug was never really fixed — only avoided.

10 min read
Supabase

Google sign-in fails on an iOS PWA saved to Home Screen

Why Firebase Google sign-in rejects redirect and hangs on popup once a web app is saved to an iPhone Home Screen, straight from the engineer who answered the issue.

9 min read
Supabase

Supabase Magic Link: The Production Checklist

A pre-launch checklist for Supabase magic link and email-OTP sign-in: the mailer cap, the redirect allow list, the PKCE email template, and the link-scanner problem that burns single-use tokens.

9 min read
Supabase

useEmulator disableWarnings: TS2554 Expected 1 arguments

Reproduced on firebase 8.10.1, 9.23.0 and 13.0.0: which declaration file rejects the options object, what disableWarnings really silences in each version, and the two fixes that compile.

8 min read
Supabase

linkWithRedirect fails with the Auth emulator: 3 causes

Three different errors hide behind one symptom, and only one of them is about the emulator. Two were reproduced with linkWithRedirect against the emulator, the API key one with the emulator disconnected.

8 min read
Supabase

auth/popup-closed-by-user fires 8 s late: cause and fix

Your login button can come back to life a fraction of a second after the user closes the Google popup, without patching the SDK or breaking slow sign-ins.

8 min read
Supabase

auth/invalid-api-key still throws without a real apiKey

The rejection happens one function call earlier than most people expect, before any server, project or emulator is ever reached.

7 min read
Supabase

Fix "More Than One Relationship Was Found" in Supabase

The embed is not broken — PostgREST just cannot guess which of two many-to-many paths you meant, and it tells you both candidates in the error body.

8 min read
Supabase

Fix Firebase 'Invalid site key or not loaded in api.js'

Trace the two Enterprise script loaders, confirm which Firebase release contains the repair, and distinguish a stale SDK from a genuine key configuration problem.

7 min read
Supabase

Firebase Google Sign-in on Vercel: Custom authDomain Fix

Keep the Next.js app on Vercel and make the Google sign-in screen name your own domain instead of the project-id.firebaseapp.com subdomain.

8 min read
Supabase

Firebase: Cannot read property 'getProvider' of undefined

Why passing firebaseConfig to getFirestore() breaks inside the Firebase SDK, reproduced on firebase 9.0.0 and 13.0.0, with the corrected Next.js module and the wrapper that only hid the bug.

7 min read
Supabase

Fix 'Failed to get document because the client is offline'

The emulator call from the Stack Overflow question, reproduced with the Node SDK against a real Firestore emulator: what the SDK builds from the host string, which other causes give the same error, and which do not.

7 min read
Supabase

Fix npm ERESOLVE: Firebase prerelease peer conflict

Read the two version requirements behind this Firebase install failure, reproduce the prerelease mismatch, and select a stable dependency tree.

8 min read
Supabase

Fix Firestore INTERNAL ASSERTION FAILED (ID: ca9)

Why rapid listener churn can push a Firestore bookkeeping counter below zero, which part of this is actually fixed, and the one mitigation reporters say works when upgrading does not.

9 min read
Supabase

Firebase Hosting 404s Every Route Except index.html

A static Next.js export deploys cleanly to Firebase Hosting, yet every page but the homepage 404s. Reproduced locally, with the config that actually fixes it.

8 min read
Supabase

Fix Firestore 'Host has been set in both settings()' error

Why Next.js reloads turn a harmless emulator warning into a hard FirebaseError, what changed in the modular SDK, and a setup that survives every reload.

8 min read
Supabase

Fix "Assertion failed: resolving hosting target" (Firebase)

firebase deploy says this "should have caused an error earlier". With a single hosting object and a dead login it did, and the CLI threw it away. Both causes, reproduced on firebase-tools 15.32.1, and how to tell them apart.

9 min read
Supabase

Fix Firebase Functions Deploy: Missing: X from lock file

The build server runs npm ci with a stricter config than your laptop. Here is why that produces dozens of "Missing" lines on a lockfile that installs fine locally, reproduced end to end.

8 min read
Supabase

Fix "supabaseUrl is required" in Supabase JS

The error reads like a typo in a URL, but almost every case is a build-time environment variable that never made it into the bundle.

7 min read
Supabase

Fix: Supabase redirectTo Ignored on Magic Link / Email Auth

Magic links and password-reset emails that always land on the production Site URL instead of the redirectTo you passed. The allow-list mechanism behind it, and the wildcard pattern for local dev and preview branches.

8 min read
Supabase

Fix: Multiple GoTrueClient instances detected (Supabase)

Supabase's auth warning means two GoTrueClient instances are racing over the same localStorage session key. The singleton pattern that fixes it, and the case where a second auth provider is the real cause.

7 min
Supabase

prepared statement s0 already exists: Fix for Prisma +

Solve the Prisma 'prepared statement s0 already exists' error caused by Supabase pooling. Add directUrl, enable pgbouncer mode, and verify your connection.

7 min read
Supabase

Prisma: Environment variable not found: DATABASE_URL

Prisma errors out with missing DATABASE_URL when the .env file isn't loaded. Trigger prisma generate and get your GraphQL query running again.

7 min read
Supabase

Cookie "__cf_bm" has been rejected for invalid domain: fix

The warning fires on every image, upload and WebSocket that touches <ref>.supabase.co in Firefox. It is Cloudflare's bot-management cookie being scoped to a Public Suffix List domain, so every browser drops it. Here is the verified cause, the cases where the noise hides a real 403 or auth bug, and how to tell them apart in two minutes.

8 min read
Supabase

Supabase Edge Function BOOT_ERROR: Fix "Failed to Bootstrap"

A Supabase Edge Function that returns BOOT_ERROR or "failed to bootstrap runtime" is failing before your code even runs. Here is how to isolate which of the four common causes is yours.

7 min read
Supabase

Better Auth vs Supabase Auth 2026: Honest Verdict

Supabase Auth integrates identity with Supabase APIs and RLS. Better Auth keeps auth in your application; database policies remain possible when you deliberately propagate a verified identity under a restricted role.

10 min read
Supabase

AuthSessionMissingError: Auth session missing! (Next.js fix)

`AuthSessionMissingError: Auth session missing!` is not a bug report — it is Supabase telling you, accurately, that the client you called had no session to work with. The hard part is that the same message covers a signed-out user, a server client that never received your cookies, a middleware that forgot to forward them, and a session the Auth server has already ended. Each has a different fix.

8 min read
Supabase

Supabase Hangs After onAuthStateChange: The Deadlock

Your app loads, the session arrives, and then every Supabase call after it hangs forever. No error, no rejected promise, no network request — the query simply never returns and the loading spinner stays up until someone reloads the page. If you fetch a profile inside your `onAuthStateChange` callback, this is a documented deadlock in supabase-js, and the fix is one line.

8 min read
Supabase

Supabase 42501: permission denied for schema auth

A view over `auth.users`, a policy that joins it, or a client query against it all fail the same way: `ERROR: 42501: permission denied for schema auth`. It is not a missing GRANT you forgot — Supabase keeps the `auth` schema out of reach of the API roles deliberately, and granting your way in is the one fix you should not apply. The supported route is a security definer function.

8 min read
Supabase

Test Supabase RLS Policies Before You Ship

Every RLS leak I have seen shipped the same way: the policy was tested in a context that does not enforce it. The Supabase SQL editor runs as a privileged role, the service key carries `BYPASSRLS`, and the table owner is exempt from its own policies unless you say otherwise. Three green checks, zero enforcement. This is the procedure that actually tests a policy — plus the two Postgres flags that decide whether your test means anything.

9 min read
Supabase

Firestore PERMISSION_DENIED: Every Real Cause and Fix

The Firestore error "PERMISSION_DENIED: Missing or insufficient permissions" never tells you which rule rejected you. Here is how to find out — and the seven causes that account for almost every occurrence.

7 min read
Supabase

Cloud Firestore vs Realtime Database in 2026

Firebase ships two databases and the official comparison page is diplomatic about it. The numbers are not: query model, pricing units, connection limits and region availability all point the same way for a new build in 2026.

9 min read
Supabase

Supabase "Database Error Saving New User" Trigger Fix

Signups fail with "Database error saving new user" the moment you add a trigger on auth.users. The trigger threw, the transaction rolled back, and auth.users never got the row. Here is the fix.

8 min read
Supabase

Sign In to Supabase Without Email Verification (2026)

Supabase asks every new signup to confirm their email before they can sign in. In local dev that is noise. Here are three ways to skip it, and the one production rule you must not break.

7 min read
Supabase

Supabase OAuth access_token hash Stuck in URL

After Supabase OAuth sign-in, access_token and refresh_token hash fragments linger in the browser URL. Here is why the implicit flow leaks them and how PKCE (or a one-line hash cleanup) strips them.

7 min
Supabase

Stop the Supabase getSession() Security Warning

The Supabase auth-js "using getSession() is insecure" warning floods your server logs on every request. Here is why getUser() fixes it and where getSession() is still safe to call.

6 min
Supabase

Is It Safe to Expose Firebase API Key to the Public?

Check which APIs a public Firebase key can call, protect data with rules, and initialise App Check before turning on enforcement.

9 min read
Supabase

Supabase getClaims() vs getSession(): The Silent Auth Bug

Your auth looks correct but users can bypass it. The bug: getSession() in server code reads from local storage without revalidating the token against the Auth server.

7 min read
Supabase

Supabase redirectTo Failing on Vercel Previews: SITE_URL Fix

The redirect silently lands on your production domain instead of the preview URL, with no error from Supabase. Here is the exact Supabase dashboard config and the Vercel env var pattern.

6 min read
Supabase

Supabase Realtime Not Receiving Events: Complete Fix

A Supabase Realtime subscription can say SUBSCRIBED and still receive nothing. This fix walks through RLS, filter syntax, stale React subscriptions, paused projects, and broadcast versus postgres_changes confusion.

8 min read
Supabase

Supabase Auth vs Clerk in 2026: The Production Verdict

This is not another feature table that ends with 'it depends.' Clerk wins for polished B2B auth and org-heavy products; Supabase Auth wins when database-native simplicity, price, and RLS integration matter more.

11 min read
Supabase

Supabase RLS Policy Not Working: 2026 Debug Checklist

RLS failures are rarely random. This checklist walks through the same order I use in production: confirm RLS is enabled, prove the role and JWT claims, then isolate USING, WITH CHECK, and service-role bypass mistakes.

12 min read
Supabase

How to get COUNT(*) in Supabase

If you are fetching whole result sets just to count them, you are paying for bandwidth and latency you do not need. Supabase already returns counts in query metadata.

5 min read
Supabase

Supabase bucket RLS policy for table objects fix

This Storage error almost never means Supabase is broken. It usually means your upload path, your RLS policy, or your use of `upsert` does not match how Storage actually authorizes writes.

7 min read
Supabase

Supabase Joins: Nested Selects, !inner, Left Joins (2026)

Supabase does support joins, but not with the SQL string most people expect. The API uses embedded relations, and a few small syntax rules change the result shape completely.

11 min read
Supabase

Does Supabase service_role Bypass RLS? Yes — Use It Safely

The Supabase service_role key bypasses every RLS policy in your database. That is exactly what you want for admin jobs, migrations, and cron tasks — and exactly what an attacker wants if it ever leaks to the client bundle. Here is how to set up the admin client in Next.js, where it is safe to use, and the three mistakes that put a root credential in your JS bundle.

12 min read
Supabase

Insert into multiple tables with one Supabase API call 2026

Learn a practical pattern for inserting into multiple tables with one Supabase API call by using a server‑side function and a transaction.

7 min read
Supabase

Supabase 42501 Permission Denied: Schema public & auth

Learn the exact steps to grant the right permissions in Supabase and stop the 'permission denied for schema public' error from breaking your app.

7 min read
Supabase

Supabase Auth Error Codes: Fixes + TS Cheat Sheet (2026)

Supabase Auth returns precise error codes — `invalid_credentials`, `weak_password`, `same_password`, `email_not_confirmed` — but most apps collapse them all into "Something went wrong." Here's the full TypeScript enum, a typed handler, and the UX pattern that doubles signup completion.

9 min read
Supabase

Fix Supabase RLS Infinite Recursion (Production 2026)

If your Supabase query returns `infinite recursion detected in policy for relation "X"`, your RLS policy is querying the same table it protects. Here's exactly why it loops, and three production-grade fixes that don't leak data.

9 min read
Supabase

Clerk vs Better Auth vs Supabase: Next.js Auth in 2026

A grounded comparison of the four major Next.js auth options — including the middleware vulnerability that changed everything, real MAU pricing math, and which architecture actually scales.

22 min read
Supabase

11 Supabase Auth Lessons From a Year in Production

Eleven recurring traps that surface once Supabase Auth is wired into a production Next.js app — drawn from public Supabase docs, the SSR guide, and the postmortems the community has published.

11 min read
Supabase

Build a Real-Time Chat App: Next.js + Supabase Production

A from-scratch, production-ready chat app built with Next.js 15 App Router and Supabase Realtime. Schema, non-recursive RLS, presence, typing indicators, infinite scrollback, and the production gotchas.

34 min read
Supabase

Supabase + Google OAuth on Next.js 15: Working Guide (2026)

A from-scratch, docs-grounded guide to wiring Google OAuth into a Next.js 15 App Router app with Supabase. Every redirect URL, every scope, every silent failure — fixed.

28 min read
Supabase

Supabase Auth + Middleware: Session Guide for Next.js 15

Every Supabase auth edge case in one guide: session refresh in middleware, cookie handling across server and client, redirect URLs that actually work, MFA flows, token rotation, and the silent failures nobody warns you about.

38 min read
Supabase

Why Your Supabase Queries Are Slow (And How to Fix)

Slow Supabase queries kill your app feel and inflate your bill. Here are the six causes I keep seeing in production apps, and the exact SQL and code fixes for each one.

13 min read
Supabase

Supabase + Next.js Tutorial for Beginners (Free, 2026)

Build a complete full-stack application with Next.js and Supabase from scratch. Authentication, database, CRUD operations, and deployment — all in 20 minutes.

20 min read
Supabase

Supabase vs Firebase in 2026: The Honest Comparison

Supabase vs Firebase — which backend should you pick in 2026? We compare pricing, performance, developer experience, and scalability with real benchmarks and code examples.

18 min read
Supabase

Supabase Storage File Uploads in Next.js: 2026 Guide

Complete guide to file uploads, image optimization, CDN integration, and media management with Supabase Storage and Next.js. Learn signed URLs, progressive uploads, and production-ready patterns.

30 min read
Supabase

Advanced Authentication Patterns with Next.js and Supabase

Master advanced authentication patterns including OAuth, magic links, passwordless auth, custom JWT, multi-tenant authentication, and enterprise SSO integration with Next.js and Supabase.

50 min read
Supabase

7 Next.js + Supabase Architecture Decisions I'd Skip

After shipping multiple production apps with Next.js and Supabase, here are the decisions that cost the most time to undo — and what I'd do instead from day one.

8 min read
Supabase

Next.js + Supabase Background Jobs & Async Patterns

Next.js serverless functions have a 10-second execution limit. Learn how to handle long-running tasks, background jobs, and async processing using Supabase Edge Functions, database queues, and pg_cron without external job queue services.

15 min read
Supabase

Supabase SSR Sessions in Next.js App Router (2026 Guide)

Understand exactly how Supabase session management works in Next.js App Router — cookies, middleware, Server Components, and Client Components — and why getting it wrong causes silent auth failures.

16 min read
Supabase

Supabase RLS Policy Design Patterns Beyond the Basics

Go beyond simple auth.uid() checks. Learn advanced Row Level Security policy patterns for multi-role systems, team-based access, hierarchical permissions, and performance-safe RLS in production Supabase apps.

16 min read
Supabase

Supabase Multi-Tenant Architecture: Best Practices 2026

Build scalable multi-tenant SaaS applications with Next.js and Supabase. Complete guide to tenant isolation, RLS policies, subdomain routing, and billing integration for production apps.

38 min read
Supabase

Next.js + Supabase: 10 Production Mistakes + Fixes (2026)

Avoid these critical mistakes when building with Next.js and Supabase. Learn from real-world errors that cost developers hours of debugging and discover proven solutions.

14 min read
Supabase

Supabase Edge Functions in Next.js: Setup to Cron (2026)

Complete guide to building and deploying Supabase Edge Functions with Next.js. Learn serverless functions, Deno runtime, database triggers, webhooks, scheduled jobs, and real-world use cases.

38 min read
Supabase

Supabase Realtime: Guide to Building Live Applications

Supabase

Supabase Auth Session Disappears on Refresh? Fix (2026)

Supabase auth sessions mysteriously disappearing after page refresh? Learn the exact cause and fix it in 5 minutes with this tested solution.

8 min read
Supabase

Supabase AuthSessionMissingError in Middleware: 5 Fixes

Auth errors crashing your Next.js middleware? Learn how to handle Supabase auth errors gracefully with proper error handling patterns.

10 min read
Supabase

Supabase Auth Callback Redirect Not Working? Next.js Fix

Auth redirect not working after Supabase sign-in? Here are the three root causes and the exact fixes — callback route, redirect URL allowlist, and router.refresh().

11 min read
Supabase

Complete Guide to Building SaaS with Next.js and Supabase

Master full-stack SaaS development with Next.js 15 and Supabase. From database design to deployment, learn everything you need to build production-ready applications.

45 min read
Supabase

Supabase "Error sending confirmation email" (500): 5 fixes

Email confirmations not sending from Supabase? Learn the exact causes and fixes for SMTP, template, and configuration issues in 10 minutes.

10 min read