fix(upload): bump middlewareClientMaxBodySize to 100mb
Next 16 caps any request body that flows through middleware at 10MB by default. Our auth middleware matches every path, so /jobs/:id POSTs from the file upload form hit 'Request body exceeded 10MB / Unexpected end of form' the moment a user picked anything bigger than ~10MB total — the server action never even ran. serverActions.bodySizeLimit alone isn't enough; the new middlewareClientMaxBodySize knob (Next 16) is the one that gates middleware-handled bodies. Set both to 100mb so the 30MB-per-file bucket limit is what actually matters. The key isn't in NextConfig's TS types yet (Next 16.1), so it's assigned via a narrow cast on the side rather than dropped into the object literal. Also added console.log/error breadcrumbs to uploadJobFilesAction so the next mystery upload failure shows up in the dev server log immediately instead of silently bouncing back as 'Bağlantı hatası'.
This commit is contained in:
@@ -61,4 +61,10 @@ const nextConfig: NextConfig = {
|
||||
},
|
||||
};
|
||||
|
||||
// Next 16 caps middleware-passed request bodies at 10MB by default. Our auth
|
||||
// middleware sees every request including job-file uploads — without this
|
||||
// override, multipart uploads larger than 10MB return "Unexpected end of
|
||||
// form". The key isn't in NextConfig's TS types yet (Next 16.1).
|
||||
(nextConfig as NextConfig & { middlewareClientMaxBodySize?: string }).middlewareClientMaxBodySize = "100mb";
|
||||
|
||||
export default nextConfig;
|
||||
|
||||
Reference in New Issue
Block a user