Continuing the discussion from The Edge Function "middleware" size is 1.01 MB and your plan size limit is 1 MB:
I checked the linked post but it didn’t solved my problem I am linking the post from next sub-reddit here, where I explained everything here
Currently deployment logs say The Edge Function "middleware" size is 1.01 MB and your plan size limit is 1 MB.
but it was not the case in previous deployments so it should deploy without any erros
I can send the open sourced repo if needed.
Turbo repo:
- Nextjs 14 (app)
- Node/express (app)
- Hono (app)
- database (prisma)
I am using neon-adapeter
to run prisma on serverless and I am not making any db calls in middleware instead I am just checking session and based on that re-routing user to a different route
additionaly, from the linked post whose solution is this documentation from prisma here can you explain the use case of this (runtime = edge)
:
import { NextResponse } from 'next/server'
import { PrismaClient } from '@prisma/client'
import { PrismaNeon } from '@prisma/adapter-neon'
import { Pool } from '@neondatabase/serverless'
export const runtime = 'edge'
export async function GET(request: Request) {
const neon = new Pool({ connectionString: process.env.DATABASE_URL })
const adapter = new PrismaNeon(neon)
const prisma = new PrismaClient({ adapter })
const users = await prisma.user.findMany()
return NextResponse.json(users, { status: 200 })
}
I have not used runtime = 'edge'
in my code any where is this the problem?
Thanks!