[▲ Vercel Community](/) · [Categories](/categories) · [Latest](/latest) · [Top](/top) · [Live](/live)

[Help](/c/help/9)

# The Edge Function "middleware" size is 1.01 MB and your plan size limit is 1 MB

386 views · 0 likes · 7 posts


Felipessantos1 (@felipessantos1) · 2024-08-19

<!-- Be sure to include all detail needed to let others see the same problem -->
I just started a new Next project with prisma and have configured it as described at [https://neon.tech/docs/guides/prisma](https://neon.tech/docs/guides/prisma) for Prisma works with the Postgres (Neon) on edge.
After push it the deploy failed on Vercel with the following message: `The Edge Function "middleware" size is 1.01 MB and your plan size limit is 1 MB.` I am pretty sure it's an issue once the project is a new and clean project, there is no functions on it, only configurations and connection with the Prisma.
I also ran `@next/bundle-analyzer` that shows my middleware is less than 300kb Any idea how to fix it?
![Screenshot 2024-08-19 at 3.40.26 PM|690x304](upload://fYoaaqsyfpGpTmnsMNxzaX6MgEL.png)


Amy Egan (@amyegan) · 2024-08-20

Hi @felipessantos1. Do you have a [minimal reproducible example](https://vercel.com/guides/creating-a-minimal-reproducible-example) to investigate the issue?


Felipessantos1 (@felipessantos1) · 2024-08-20

Hi @amyegan , I just added you to the repo: https://github.com/FelipeSSantos1/brokerwiseflow


Felipessantos1 (@felipessantos1) · 2024-08-23

Hi @amyegan any luck with that?


Felipessantos1 (@felipessantos1) · 2024-08-24

The problem in my case was related to prisma adapter
```
// import { Pool, neonConfig } from "@neondatabase/serverless"
// import { PrismaNeon } from "@prisma/adapter-neon"
import { PrismaClient } from "@prisma/client"
import axios, { AxiosError } from "axios"
import { NextResponse } from "next/server"
// import ws from "ws"

// https://neon.tech/docs/guides/prisma
// neonConfig.webSocketConstructor = ws
// const connectionString = `${process.env.POSTGRES_URL}`

const prismaClientSingleton = () => {
  // const neon = new Pool({ connectionString })
  // const adapter = new PrismaNeon(neon)
  // return new PrismaClient({ adapter })
  return new PrismaClient()
}
```

We cannot put prisma to run on edge :expressionless:


Felipessantos1 (@felipessantos1) · 2024-08-24

source: https://www.prisma.io/docs/orm/prisma-client/deployment/edge/deploy-to-vercel#size-limits-on-free-accounts


Amy Egan (@amyegan) · 2024-08-25

Thanks for coming back to share the answer. The [Edge Runtime](https://vercel.com/docs/functions/runtimes#edge) does have some differences from the [Node.js Runtime](https://vercel.com/docs/functions/runtimes#node.js) that are worth considering.

If anyone else finds this post and wants to learn more about the differences, they can find more info in the docs here: 
https://vercel.com/docs/functions/runtimes#choosing-a-runtime