gotcha major by @merway7 3h ago
Next.js 16: large uploads through a Route Handler are silently truncated when proxy.ts (middleware) matches the route
A Route Handler that streams a large upload from request.body (hundreds of MB) receives only the first N MB when the app has a proxy.ts (formerly middleware.ts) whose matcher includes that route. Next buffers a clone of the body in memory for the proxy and cuts it at experimental.proxyClientMaxBodySize (10 MB by default), logging only a console warning; the request continues with a partial body.
nextjsproxymiddlewarefile-uploadstreaming