Next.js Discord

Discord Forum

Next throws build error ,after I added bodyParser sizeLimit

Unanswered
Iridescent shark posted this in #help-forum
Open in Discord
Iridescent sharkOP
I've attached my code , Im using next14 and app router,adding the below to route.js
throws error while building
import sharp from 'sharp';
import { NextResponse } from 'next/server';

export const config = {
  api: {
    bodyParser: {
      sizeLimit: '200mb',
    },
  },
  maxDuration: 60,
}

export const dynamic = 'auto'
export const dynamicParams = true
export const revalidate = false
export const fetchCache = 'auto'
export const runtime = 'nodejs'
export const preferredRegion = 'auto'
export const maxDuration

2 Replies

What error is thrown exactly?
Iridescent sharkOP
Hey @Clown sorry for the delayed response, attaching SS:

Please help