payloadcms / payload

Payload is the open-source, fullstack Next.js framework, giving you instant backend superpowers. Get a full TypeScript backend and admin panel instantly. Use Payload as a headless CMS or for building powerful applications.
https://payloadcms.com
MIT License
25.49k stars 1.62k forks source link

4.5MB Upload Limit when deployed on Vercel #8231

Closed iiskakov closed 4 weeks ago

iiskakov commented 1 month ago

Link to reproduction

https://github.com/iiskakov/is-it-really-one-click-though

Environment Info

"payload": "3.0.0-beta.68"
"next": "15.0.0-canary.77"

Describe the Bug

When deploying a Payload v3 project on Vercel using the S3 plugin for file uploads, Vercel’s 4.5MB file upload limit still applies. This severely restricts media-heavy projects, as file uploads beyond this size fail, even though external storage (S3) is configured. This limitation isn’t documented, and it's critical for projects relying on large file uploads, especially given Payload’s “Next.js-first” marketing for v3.

Reproduction Steps

  1. Deploy a Payload v3 project using the Vercel quick-deploy template.
  2. Configure S3 storage for file uploads.
  3. Attempt to upload a file larger than 4.5MB (e.g., 30MB video).
  4. The upload will fail due to Vercel’s default upload limit, even though S3 is integrated.

Adapters and Plugins

@payloadcms/storage-s3

robinscholz commented 1 month ago

We ran into the same issue earlier. Here’s a bit more info: https://vercel.com/docs/errors/FUNCTION_PAYLOAD_TOO_LARGE

iiskakov commented 1 month ago

We ran into the same issue earlier. Here’s a bit more info: https://vercel.com/docs/errors/FUNCTION_PAYLOAD_TOO_LARGE

Yup, thanks, I've seen this. If I understood it correctly - vercel functions are not supposed to be used to transfer data basically, and current way of how uploads are implemented uses them (not by design though) 🤔

ChristopherNowlan commented 1 month ago

Is there any movement on this? Or work arounds.

drewlonious commented 1 month ago

I would love to hear more about this too

JarrodMFlesch commented 4 weeks ago

Yes, this is a known limitation. We need to implement client uploads, so the uploads do not go through Vercel which limits the file size that can be uploaded. Here is the related discussion: https://github.com/payloadcms/payload/discussions/7569

drewlonious commented 4 weeks ago

Hey @JarrodMFlesch is there a current recommended workaround to just upload directly to s3 or s3 compatible storage like supabase, r2, while still integrating with the admin media collection?

github-actions[bot] commented 3 weeks ago

This issue has been automatically locked. Please open a new issue if this issue persists with any additional detail.