From 7674f12c5eb7fed63e2a5d8996fe23108b90e538 Mon Sep 17 00:00:00 2001 From: subodh Date: Fri, 13 Mar 2026 11:09:54 +0530 Subject: [PATCH] config: add proxyClientMaxBodySize and allowedDevOrigins - Set experimental.proxyClientMaxBodySize to 300mb so the Next.js proxy layer does not truncate uploads before they reach the FastAPI backend (backend enforces 50 MB unauth / 250 MB auth) - Add allowedDevOrigins for 192.168.18.8 to suppress the cross-origin dev warning when accessing the dev server from the local network - Regenerate next-env.d.ts (build path change, no functional effect) --- frontend/next-env.d.ts | 2 +- frontend/next.config.ts | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/frontend/next-env.d.ts b/frontend/next-env.d.ts index 9edff1c..c4b7818 100644 --- a/frontend/next-env.d.ts +++ b/frontend/next-env.d.ts @@ -1,6 +1,6 @@ /// /// -import "./.next/types/routes.d.ts"; +import "./.next/dev/types/routes.d.ts"; // NOTE: This file should not be edited // see https://nextjs.org/docs/app/api-reference/config/typescript for more information. diff --git a/frontend/next.config.ts b/frontend/next.config.ts index 4ea02cf..e9a86e8 100644 --- a/frontend/next.config.ts +++ b/frontend/next.config.ts @@ -1,6 +1,14 @@ import type { NextConfig } from "next"; const nextConfig: NextConfig = { + allowedDevOrigins: ["192.168.18.8"], + experimental: { + // The Next.js proxy layer buffers request bodies in memory; the default + // cap is 10 MB. Raise it to 300 MB so that large file uploads are not + // truncated before they reach the FastAPI backend (which itself enforces + // 50 MB for unauthenticated and 250 MB for authenticated requests). + proxyClientMaxBodySize: "300mb", + }, async rewrites() { return [ {