From b6135272105b5576bf799107cb3e177f84c86665 Mon Sep 17 00:00:00 2001 From: shrimbly Date: Thu, 8 Jan 2026 23:15:05 +1300 Subject: [PATCH] Update body size limit for server actions, refactor image file reading to use promises, and enhance error handling in project save function. --- next.config.ts | 2 +- src/app/api/quickstart/route.ts | 6 +++--- src/components/Header.tsx | 5 ++++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/next.config.ts b/next.config.ts index 00284566..e2916b01 100644 --- a/next.config.ts +++ b/next.config.ts @@ -4,7 +4,7 @@ const nextConfig: NextConfig = { reactStrictMode: true, experimental: { serverActions: { - bodySizeLimit: "2gb", + bodySizeLimit: "50mb", }, }, turbopack: { diff --git a/src/app/api/quickstart/route.ts b/src/app/api/quickstart/route.ts index 8da0b3f1..80300369 100644 --- a/src/app/api/quickstart/route.ts +++ b/src/app/api/quickstart/route.ts @@ -9,8 +9,8 @@ import { parseJSONFromResponse, } from "@/lib/quickstart/validation"; import { ImageInputNodeData } from "@/types"; -import * as fs from "fs"; -import * as path from "path"; +import fs from "fs/promises"; +import path from "path"; export const maxDuration = 60; // 1 minute timeout @@ -27,7 +27,7 @@ async function convertLocalImagesToBase64(workflow: WorkflowFile): Promise { - saveToFile(); + saveToFile().catch((error) => { + console.error("Failed to save project:", error); + alert("Failed to save project. Please try again."); + }); }, 50); };