Prisma · runtime error
PrismaClient is not configured to run in Edge Runtime
Error: PrismaClient is not configured to run in Edge Runtime (Vercel Edge Functions, Vercel Edge Middleware, Next.js (Pages Router) Edge API Routes, Next.js (App Router) Edge Route Handlers or Next.js Middleware). In order to run Prisma Client on edge runtime, either:
- Use Prisma Accelerate: https://pris.ly/d/accelerate
- Use Driver Adapters: https://pris.ly/d/driver-adaptersWhat it means
The default Prisma 6 client needs Node.js. Code that imports it is running on the Edge runtime or Cloudflare Workers, where it can't open a normal database connection.
Common causes
- export const runtime = "edge" on a route or page that queries the database
- An old middleware.ts (Edge) that calls auth() with a Prisma adapter
- Deploying a Node.js Next.js app to Cloudflare Workers without a driver adapter
How to fix it
- Delete export const runtime = "edge": the Node.js runtime is the default and runs Prisma fine
- On Next.js 16, rename middleware.ts to proxy.ts: proxy runs on Node.js
- If you really need the edge or Workers, use a driver adapter (Neon, PlanetScale, D1) or Prisma Accelerate
Prompt for Cursor or Claude Code
Prisma Client fails on the Edge runtime. Find every export const runtime = "edge" in files that import db (directly or through auth), remove it so the route uses the default Node.js runtime, and on Next.js 16 make sure middleware.ts is migrated to proxy.ts. Don't add Prisma Accelerate unless I ask.Not quite your error? Paste yours into the free VibeBoot Doctor or browse the Prisma error fixer.
next: skip the next one
Skip the setup. The VibeBoot SaaS Starter ships a ready prisma/schema.prisma and one Prisma client in src/lib/db.ts (SQLite by default, Postgres by changing the provider), plus auth and Stripe on Next.js 16.4.3. $49, one-time.
14-day money-back guarantee · lifetime updates
Other Prisma errors
$ fixed it? get the next one first
New fixes for what AI agents break, by email.
When we add a fix or a Cursor rule for a new Next.js, Auth.js, Prisma or Stripe break, it goes out in the VibeBoot newsletter. Free, occasional, unsubscribe in one click.