MaxBodySize config didnt work on nextjs 14
Unanswered
Noronha posted this in #help-forum
NoronhaOP
I tried this config in prod:
But it didnt work in prod (using vercel).
Nextjs version 14.1.2
I've done it like in the docs
https://nextjs.org/docs/app/api-reference/next-config-js/serverActions
Any help?
/** @type {import('next').NextConfig} */
const nextConfig = {
experimental: {
serverActions: {
bodySizeLimit: '50mb',
},
},
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'lh3.googleusercontent.com',
pathname: '**',
},
],
},
};
module.exports = nextConfig;But it didnt work in prod (using vercel).
Nextjs version 14.1.2
I've done it like in the docs
https://nextjs.org/docs/app/api-reference/next-config-js/serverActions
Any help?
22 Replies
Fire ant
Do you want to upload file?
NoronhaOP
Yes, it's for fileupload.
Fire ant
Vercel max size limit is 5mb
NoronhaOP
it's a vercel issue then ohhh... Is there a way to increase that?
Fire ant
What plan do u use?
NoronhaOP
currently free.
Fire ant
Im on hobby plan
Yea, u cant change
They limit to 5mb
NoronhaOP
I'm going to upgrade to pro then... 20 bucks a month
@Noronha I'm going to upgrade to pro then... 20 bucks a month
Fire ant
If it can increase the size limit then its good
In the FAQ there's this URL:
https://vercel.com/docs/platform/limits
https://vercel.com/docs/platform/limits
But didn't see anything about the 5mb body size limit.
@Noronha Found this:
https://vercel.com/guides/how-to-bypass-vercel-body-size-limit-serverless-functions
Fire ant
Last time 5mb, now 4.5mb lol
Other solution is you can try use chunk upload
NoronhaOP
I'm using s3 in the server action (on the server) because I dont want to expose my keys. I'm using a public bucket, so I dont have signed urls or anything like that. I dont really want to upload in chunks 😦 I think I'll generate an URL and make the client-component upload directly to S3. What do you think?
Fire ant
I dont really upload big file using Vercel platform, for me personally i use my own vps server to setup what i need, because on Vercel (and other platform) you are strictly limited to server request body it can handle(4mb)
The best way for me, use vps....its all under your control. I could upload files up to 20gb.
You still can use the serverless edge function https://blog.danoph.com/how-to-upload-large-files-directly-to-amazon-s3-in-reactnextjs