How to Get Enums in Prisma Client: Import, Query
Stuck trying to access Prisma enum values? This guide shows you exactly how to import, use, and validate generated enum types in your Node.js app.
Explore practical articles covering Next.js, Supabase, SaaS engineering, AI integrations, and production debugging. Ship cleaner systems faster.
111 articles
Stuck trying to access Prisma enum values? This guide shows you exactly how to import, use, and validate generated enum types in your Node.js app.
Firebase Auth stores its session in an IndexedDB database called firebaseLocalStorageDb. When that connection closes mid-session, sign-in throws InvalidStateError. Here is the cause, the SDK version that changed the behaviour, and a Next.js App Router setup that degrades gracefully.
One Firebase release put "default" before "browser" in the package.json exports map of 30 packages, and webpack's resolver refuses that. Here is the exact error, the diff that caused it, the release that fixed it, and how to find any other package in node_modules doing the same thing.
An admin clicked "Grant admin consent" and the n8n Microsoft credential still fails. The grant was real; it just did not cover the app or the scopes n8n actually requests. Here is the Entra ID checklist that ends it.
Running firebase experiments:enable webframeworks on your laptop does nothing for GitHub Actions. Here is the env var the CLI actually reads, the complete workflow, and why Firebase now steers Next.js apps to App Hosting.
"You're importing a component that imports react-dom/server" is a compile-time rule of the App Router, not a bug in your code. Here is what the rule protects, which use cases are legitimate, and the fixes verified against Next.js 15.5 and 16.3 with both webpack and Turbopack.
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.
Run tsc --noEmit on a project that compiles fine in the editor and the terminal lights up with type errors from inside node_modules. The fix is skipLibCheck, plus two
A fresh Homebrew install of PostgreSQL on a Mac completes without errors, then psql answers connection refused because the server was never started. Which command starts it depends on
The Firebase Google sign-in popup loses window.closed access when a COOP header isolates the opener. Here's the exact header change that restores the popup flow.
When Firestore throws 'Expected first argument to collection()', it's almost always a missing Firestore instance. Learn the exact fix for Next.js and v9 modular SDK.
Next.js 16 build crashes prerendering the internal /_not-found route. Here are the three actual causes behind it, how to tell which one is yours, and the fix for each.
Next.js 16 replaced implicit caching with the explicit "use cache" directive. Here is what actually breaks when you flip cacheComponents on, and how to fix it without reverting.
TypeScript 6.0 shipped in March 2026 with strict mode on by default and several legacy options removed. Here is what actually breaks migrating a real Next.js + Supabase codebase, in the order to fix it.
Both of these will authenticate a user perfectly well, so comparing sign-in methods is a waste of your afternoon. The decision that actually costs you later is where authorisation is enforced. Supabase Auth puts a user id inside the database so policies can use it; Better Auth puts sessions in a table you own and leaves enforcement to your application. Pick the wrong one and you are rewriting your security model, not swapping a library.
`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 `getUser()` call that fired before the session was restored. Each has a different fix.
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.
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.
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.
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.
The @/* alias fails in four different places for four different reasons. A 60-second checklist, then a fix per resolver: Next.js build, TS server, Jest and ESLint.
The error fires when psql reaches the password prompt but the password PostgreSQL has on file does not match what you typed — common after switching auth methods, restoring from a dump, or using Docker with a baked-in password. Fix it by setting a password with ALTER USER inside psql, then verifying pg_hba.conf has scram-sha-256 (not md5 or trust) for the line matching your connection.
The error fires when the shell cannot locate the psql binary — either PostgreSQL is not installed (only the server or a GUI client is), or it is installed but its bin directory is not on PATH. Fix it by installing the postgresql-client package (apt/brew), installing PostgreSQL itself (choco on Windows), or appending the bin directory to PATH.
AWS S3 is the default for object storage, but for EU-only workloads it is more expensive than necessary and you must explicitly select an EU region to satisfy GDPR data residency. Scaleway Object Storage stores every byte in Paris or Amsterdam by default — there is no US region to opt out of — uses the same S3-compatible API, and costs 50-70% less for typical workloads. Here is the 2026 pricing breakdown, the API parity list, and the gotchas that make Scaleway a no-go for some workloads (no Glacier tier, fewer storage classes, no Lambda@Edge equivalent).
Google Analytics 4 is found illegal in multiple EU countries (Austria, France, Italy, Denmark, Finland, Norway, Sweden) because it transfers user data to the US. To stay compliant you need a consent banner, a Data Processing Agreement, and Consent Mode v2 — and the EU-US Data Privacy Framework on which Google relies is itself under legal threat at the EU's top court. Self-hosted Plausible Analytics collects no personal data, sets no cookies, and runs on your own server. Here is the 2026 setup, the cost, the feature gaps you should plan for (no heatmaps, no BigQuery export, no Google Ads Smart Bidding), and the deployment steps on a Hetzner VPS or Scaleway Stardust.
Dropping tables one by one is painful. Here is the one-command reset, the PostgreSQL 15 permission gotcha that breaks it, and the safe way to do it on Supabase.
`ALTER ROLE alice WITH PASSWORD 'newpass';` is the SQL. The psql `\password` prompt avoids logging the cleartext. In Supabase the `postgres` role password is reset from the Dashboard, not SQL. Here is each method, the scram-sha-256 default, and the three things that break after a password change.
Coming from MySQL you type `SHOW TABLES` or `DESCRIBE table` and PostgreSQL throws a syntax error — both are MySQL commands. The psql equivalents are `\dt` (list tables) and `\d table_name` (describe a table); the portable SQL equivalents are `information_schema.tables` and `information_schema.columns`. Here is exactly what to run in psql, the Supabase SQL editor, Drizzle, or any client, plus why your query returns zero rows.
Coming from MySQL you type DESCRIBE table and psql throws a syntax error. The psql equivalent is \d table_name. For Supabase, Drizzle, or any SQL client without backslash commands, use the information_schema.columns view.
The error fires when PostgreSQL's peer auth check compares the OS username to the database role and they differ — common after sudo-ing into psql or in local dev. Fix it by matching users, or by switching the local auth method to scram-sha-256 with a real password.
The error only surfaces during the production build — dev mode hides it completely. Here is why, and the three fixes ranked by situation.
Without a matcher, proxy.js runs on every request including _next/static and public assets. And Server Functions are not separate routes — a matcher gap silently drops auth coverage.
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.
The redirect lands on your production domain instead of the preview URL, or you get a "redirect URL not allowed" error. Here is the exact Supabase dashboard config and the Vercel env var pattern.
Configure VERCEL_EXPERIMENTAL_DEV_SKIP_LINK to skip the Vercel CLI dev link and speed up local Next.js development.
TypeScript getter/setter errors come from ES target misconfiguration or type mismatches. Fix TS1056, TS1028, and TS2378 in minutes.
Fix TS2322 by understanding when ReactNode, JSX.Element, and ReactElement apply in React + TypeScript component typing.
"ChunkLoadError: Loading chunk 5760 failed" almost always means a user has an old tab open after you shipped a new deploy. The fix is configuration — deploymentId, build IDs, and CDN headers — not a try/catch.
Next.js throws this when a route it wants to render at build time calls a dynamic function — cookies(), headers(), searchParams, or a no-store fetch. The fix is either opt the route into dynamic rendering, or remove the request-time dependency if it should be static.
next/image strictly allow-lists remote hosts. The fix is images.remotePatterns in next.config — matched exactly on protocol, hostname, port, and pathname. Get one wrong (http vs https, a subdomain, a missing port) and it still blocks.
The #1 misconception in the App Router: "use server" is not the opposite of "use client". One marks a client boundary in the module graph; the other exposes callable server functions. Server Components are the default — no directive needed.
Postgres aborts one transaction with 40001 to prevent a serialization anomaly. The docs are explicit: apps using REPEATABLE READ or SERIALIZABLE must be prepared to retry. Here's the correct retry loop and how to reduce conflicts.
23503 means a foreign key relationship is broken. Inserting a child before its parent? Insert the parent first. Can't delete a parent with children? Choose an ON DELETE action. The most common Supabase case is a profiles row referencing auth.users.
The "greatest-N-per-group" problem: one representative row per group. Postgres solves it with DISTINCT ON; supabase-js can't express that directly, so you wrap it in a view or an RPC function. Both confirmed by Supabase maintainers.
TS7016 fires when you import an untyped JavaScript module under noImplicitAny. The right fix is usually `npm i -D @types/X` — but sometimes the package already ships types, and sometimes you need to write a one-line declaration.
TS2305 says the export you're importing doesn't exist under that name. The cause is almost always one of: a typo, default-vs-named confusion, a CJS/ESM interop mismatch, or @types drifting from the runtime package. Each has a precise fix.
TS2564 fires when a class field is typed but never guaranteed to be set. The fix depends on WHY it's unset: a default value, constructor assignment, the definite-assignment `!`, or an optional `?`. Picking the wrong one hides real bugs.
Learn how to safely extend the Window interface in TypeScript using declaration merging, type assertions, and bracket notation to avoid compile-time errors.
A green build only proves the bundle compiled. This postmortem walks through three production-only failures: missing Vercel env vars, Edge runtime imports, and cache behavior that changed after deploy.
Middleware that works locally can disappear in Vercel production because the matcher never matches, Edge bundles a Node-only import, or auth middleware cannot read the token. This guide gives you the diagnosis order I use before touching app code.
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.
If your <Image / component ignores height: 100% and appears too small or misaligned, the issue is almost always that the parent container lacks an explicit
You see "Module not found: Can't resolve 'encoding'" in your Vercel deployment logs. This guide explains why it happens with cross-fetch/node-fetch and how to fix it permanently.
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.
If `router.query` examples keep breaking on you, the problem is usually that you're mixing App Router and Pages Router APIs. Here is the exact fix for each case.
This n8n webhook error is usually not about your payload. It is almost always a test-vs-production URL mixup or an inactive workflow.
If your redirect works only after render, flickers, or fires in the wrong place, you are probably using the wrong redirect API for the job. Here is the exact mapping.
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.
If your logs, API calls, or subscriptions fire twice in local dev, you are probably seeing React's development-only Strict Mode check. Here is what to fix and what not to panic about.
Learn why your dynamic route parameter appears as undefined in getServerSideProps and how to correctly extract it from the context object for server-side data fetching.
Next.js 15 drops support for older Node versions. Here is how to upgrade to Node.js 18.18.0 or later and fix build errors.
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.
Step‑by‑step guide to adding a PostgreSQL enum type and column in Supabase, including verification and common pitfalls.
Change the default Next.js port when it collides with another process. Step‑by‑step fix with code, verification, and prevention tips.
A step‑by‑step fix for the React 18 hydration mismatch error in Next.js apps, covering root cause, code changes, verification, and prevention.
Learn the exact steps to grant the right permissions in Supabase and stop the 'permission denied for schema public' error from breaking your app.
When LCP data never appears in your analytics, a missing reportWebVitals export is usually to blame. Follow these steps to fix it.
Learn how to instrument Largest Contentful Paint (LCP) in a Next.js project, send the metric to your analytics provider, and verify that the data is accurate.
A production‑grade fix for the `TypeError: cookies() is not a function` crash that appears in Next.js route handlers after a deploy.
Next.js 15 broke synchronous `cookies().get()`. Every server-side call must now `await cookies()` first. Here's the precise migration — App Router pages, route handlers, Server Actions, and Supabase SSR — plus the codemod that fixes 90% of call sites automatically.
Your Server Action mutates data but the page shows stale values until you hard-refresh. `revalidatePath` is one of those APIs that "succeeds" while doing nothing. Here are the six reasons it no-ops, with the exact fix for each — including the one nobody tells you about: `dynamic = 'force-static'`.
If Stripe webhooks return `Webhook signature verification failed`, your Next.js route is parsing the JSON before Stripe sees it. Here's the exact raw-body pattern for App Router, Pages Router, and Vercel Edge — plus the three secret-mismatch traps that cause the same error.
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.
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.
We tested all four major auth solutions across 50+ real-world scenarios in production. Here is the honest comparison nobody else gives you — including the middleware vulnerability that changed everything, migration costs, and which one actually scales.
Added images to my Next.js app and watched my Core Web Vitals tank. After debugging for days, here are the 7 fixes that brought my CLS score back to green.
My mutations worked but the UI showed stale data. Took me a week to understand Next.js App Router caching. Here are the 6 fixes that made my data fresh again.
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.
Upgraded to Next.js 15 and suddenly your data is stale — or refreshing too often? The caching model changed completely. Here is what actually happens and how to control it.
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.
Client reports were taking 3 hours every Friday. After one weekend building an n8n automation, they now take 10 minutes to review and send. Here's the workflow, the mistakes I made, and the parts that surprised me.
My n8n workflow was silently failing every Tuesday for three weeks. No errors, no alerts, just nothing happening. Here's the debugging story and the monitoring setup I built so it can never sneak past me again.
I was paying $120/month on Zapier and barely using a third of it. Here's the honest story of migrating to n8n — the wins, the failures, and the one thing that almost made me give up.
$50/month in OpenAI API charges was eating into my automation ROI. I switched to Ollama for local AI and my costs dropped to zero. Here's the full setup and honest tradeoffs.
A $4,000 project slipped through my fingers because I missed a contact form email. Here's the n8n automation I built to make sure that never happens again — and it cost nothing to run.
Stop shoving everything into the components folder. Learn the Feature-Sliced Design pattern adapted perfectly for the Next.js App Router.
Build a complete full-stack application with Next.js and Supabase from scratch. Authentication, database, CRUD operations, and deployment — all in 20 minutes.
Supabase vs Firebase — which backend should you pick in 2026? We compare pricing, performance, developer experience, and scalability with real benchmarks and code examples.
Thousands of developers are migrating from Firebase to Supabase. Here is why — with real migration stories, cost savings, and a step-by-step guide to make the switch.
Build a Next.js app that works offline, queues writes, and syncs cleanly to Supabase when the network returns — IndexedDB, sync queue, conflict resolution, with code.
Master RLS debugging techniques. Learn how to identify, diagnose, and fix Row Level Security policy issues that block data access in production.
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.
RLS failures don't throw errors — they return empty results. Here is exactly how to find and fix the most common Row Level Security bugs in Supabase before they reach production.
Seven recurring patterns from production runs of Next.js + Supabase, and the fixes that prevented the most common failures.
How we went from failing enterprise security requirements to passing SOC 2 compliance in 6 weeks. The authentication architecture patterns that actually work at scale.
Understand the differences between Server Actions and API Routes in Next.js 15. Learn when to use each approach with real-world examples and performance comparisons.
Avoid common Supabase Realtime pitfalls that cause memory leaks, missed updates, and performance issues. Learn real-world solutions from production applications.
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.
The 7 optimizations that took a sluggish Next.js + Supabase app from 4.2s LCP to 1.1s — RLS indexes, ISR config, image pipeline, and the connection-pooler trap on Vercel.
Supabase auth sessions mysteriously disappearing after page refresh? Learn the exact cause and fix it in 5 minutes with this tested solution.
Auth errors crashing your Next.js middleware? Learn how to handle Supabase auth errors gracefully with proper error handling patterns.
Side-by-side benchmarks on real apps — build time, bundle size, runtime perf, and the breaking changes that hurt. The honest verdict on whether the upgrade is worth it.
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().
Compare Supabase and Firebase authentication features, pricing, performance, and developer experience. Learn which backend solution fits your Next.js project best.
Environment variables not working on Vercel? Learn the exact configuration needed for Next.js 15 deployment with zero errors.
Hydration mismatch errors breaking your Next.js app? Learn the root causes and 8 proven fixes to eliminate these errors permanently.
Module not found errors only in production? Learn why Next.js builds fail after deploy and get 6 proven fixes that work on Vercel, AWS, and other platforms.
Turbopack stuck on compiling in Next.js 15/16? Learn the exact causes and 5 proven fixes, plus how to disable Turbopack safely with next build --webpack when production builds crash.
Email confirmations not sending from Supabase? Learn the exact causes and fixes for SMTP, template, and configuration issues in 10 minutes.
Step-by-step guide to creating a production-ready Docker development environment with hot reload, debugging, and Docker Compose.
Migrate a JS codebase to TypeScript file-by-file — no full rewrite required. The tsconfig settings, file order, and tricks for handling untyped packages along the way.
Get the latest articles, insights, and expert perspectives delivered straight to your inbox.
One email a month — no fluff
RLS gotchas, Next.js cache debugging, and the one Supabase setting that bit me last month.