IssueRaiser

Support Vercel Edge Runtime/Functions

## Problem Prisma Client currently does not work in the [Vercel Edge Runtime](https://vercel.com/docs/concepts/functions/edge-functions/edge-runtime), which is used to run Edge Functions by Vercel. Vercel's Edge Runtime is automatically used to run the API endpoint of your Next.js app [when you define `export const runtime = "nodejs"` for your routes](https://nextjs.org/docs/app/building-your-application/rendering/edge-and-nodejs-runtimes#segment-runtime-option). When trying to build your app, you get an error like this: ``` ... - info Collecting page data ../workspace/next13-prisma-edge/.next/server/app/api/data/route.js:25 Error: PrismaClient is unable to be run under the Vercel Edge Runtime. In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues at new t.PrismaClient (/workspace/next13-prisma-edge/.next/server/app/api/data/route.js:25:811) at 126 (/workspace/next13-prisma-edge/.next/server/app/api/data/route.js:13:48830) ... ``` ## Suggested solution Prisma needs to improve the support for the Edge Runtime and Edge Functions. Because of the platform limitations, that will always work slightly differently than using Prisma in a Node.js or serverless environment, but we will do our best to communicate that via documentation. Additionally, Prisma should implement support for serverless database drivers from databases like [PlanetScale](https://github.com/prisma/prisma/issues/15265) and [Neon](https://github.c

Posted by janpio on Aug 5, 2023, 8:09 AM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.2,000 issues0 comments

support (SaaS)

Support Vercel Edge Runtime/Functions

janpioAug 5, 2023, 8:09 AM

## Problem Prisma Client currently does not work in the [Vercel Edge Runtime](https://vercel.com/docs/concepts/functions/edge-functions/edge-runtime), which is used to run Edge Functions by Vercel. Vercel's Edge Runtime is automatically used to run the API endpoint of your Next.js app [when you define `export const runtime = "nodejs"` for your routes](https://nextjs.org/docs/app/building-your-application/rendering/edge-and-nodejs-runtimes#segment-runtime-option). When trying to build your app, you get an error like this: ``` ... - info Collecting page data ../workspace/next13-prisma-edge/.next/server/app/api/data/route.js:25 Error: PrismaClient is unable to be run under the Vercel Edge Runtime. In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues at new t.PrismaClient (/workspace/next13-prisma-edge/.next/server/app/api/data/route.js:25:811) at 126 (/workspace/next13-prisma-edge/.next/server/app/api/data/route.js:13:48830) ... ``` ## Suggested solution Prisma needs to improve the support for the Edge Runtime and Edge Functions. Because of the platform limitations, that will always work slightly differently than using Prisma in a Node.js or serverless environment, but we will do our best to communicate that via documentation. Additionally, Prisma should implement support for serverless database drivers from databases like [PlanetScale](https://github.com/prisma/prisma/issues/15265) and [Neon](https://github.c

Comments (0)

No comments yet. Start the discussion.

Comment on this issue