bodyParser sizeLimit in App router route handlers
Unanswered
West African Crocodile posted this in #help-forum
West African CrocodileOP
I have a post endpoint of content type FormData that i'm using to create a resource on my platform as well as add images for the resource. It seems like my body payload including the pictures can't exceed 1mb. I'm trying to increase the sizeLimit of my request body. I was using
locally and that was working but that fails to deploy on Vercel cause its deprecated. I can't see a bodyParser option in the new route custom config docs. How do I increase the sizeLimit?
export const config = { { api: { bodyParser: { sizeLimit: '10mb' } } }locally and that was working but that fails to deploy on Vercel cause its deprecated. I can't see a bodyParser option in the new route custom config docs. How do I increase the sizeLimit?
19 Replies
@West African Crocodile I have a post endpoint of content type FormData that i'm using to create a resource on my platform as well as add images for the resource. It seems like my body payload including the pictures can't exceed 1mb. I'm trying to increase the sizeLimit of my request body. I was using
export const config = { { api: { bodyParser: { sizeLimit: '10mb' } } }
locally and that was working but that fails to deploy on Vercel cause its deprecated. I can't see a bodyParser option in the new route custom config docs. How do I increase the sizeLimit?
Asiatic Lion
what I had to do was create a pages dir specifically for the api endpoint
and then put that config there
apparently for app directory, the 1mb is a strict limit in the code
hope they change
West African CrocodileOP
Damn, I was really hoping to avoid that solution lol
Cause pages doesn't have automatic parsing for Form Data
@West African Crocodile Damn, I was really hoping to avoid that solution lol
Asiatic Lion
lmao yeah me too
but i didnt find a solution for app dir
since im sending image base64s through the body
West African CrocodileOP
Same :/
you can't do 10 MB
Asiatic Lion
is this a only vercel issue or a local and vercel issue?
as for the nextjs limit, i don't think one exists, because bodyParser is not present
only a vercel issue
Asiatic Lion
i had it for both
hm
West African CrocodileOP
Idk cause the requests dont work until I add the bodyparser sizelimit