Why Vercel Next.js routes time out or reject large video saves, and how to fix them
A Next.js app on Vercel that fetches a video from a link and saves it can fail with timeout or payload-size errors even when it works locally. Vercel's Functions limits cap request bodies and buffered responses at 4.5 MB, and cap maximum duration and bundle size, while a 10-minute 720p video is around 77 MB. The article explains which error codes map to which limit and recommends streaming a direct file URL into Vercel Blob rather than buffering it. It also suggests client-side uploads straight to Blob and sending browsers a Blob URL for playback. The author notes that links from web pages rather than direct files need a downloader, which adds bundle size and can be blocked from cloud servers.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in