Skip to content

Conversation

@zdql
Copy link
Contributor

@zdql zdql commented Oct 14, 2025

No description provided.

@railway-app
Copy link

railway-app bot commented Oct 14, 2025

🚅 Deployed to the echo-pr-564 environment in echo

Service Status Web Updated (UTC)
echo ◻️ Removed (View Logs) Web Oct 17, 2025 at 6:07 pm

@vercel
Copy link
Contributor

vercel bot commented Oct 14, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
assistant-ui-template Ready Ready Preview Comment Oct 17, 2025 7:31pm
component-registry Ready Ready Preview Comment Oct 17, 2025 7:31pm
echo-control (staging) Ready Ready Preview Comment Oct 17, 2025 7:31pm
echo-next-boilerplate Ready Ready Preview Comment Oct 17, 2025 7:31pm
echo-next-image Ready Ready Preview Comment Oct 17, 2025 7:31pm
echo-next-sdk-example Ready Ready Preview Comment Oct 17, 2025 7:31pm
echo-video-template Ready Ready Preview Comment Oct 17, 2025 7:31pm
echo-vite-sdk-example Ready Ready Preview Comment Oct 17, 2025 7:31pm
next-chat-template Ready Ready Preview Comment Oct 17, 2025 7:31pm
react-boilerplate Ready Ready Preview Comment Oct 17, 2025 7:31pm
react-chat Ready Ready Preview Comment Oct 17, 2025 7:31pm
react-image Ready Ready Preview Comment Oct 17, 2025 7:31pm

Comment on lines +20 to +26
export const config = {
api: {
bodyParser: {
sizeLimit: '4mb',
},
},
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The export const config with bodyParser configuration is incompatible with Next.js App Router and will be ignored.

View Details
📝 Patch Details
diff --git a/templates/next-image/next.config.ts b/templates/next-image/next.config.ts
index 59692f72..fa32ad5e 100644
--- a/templates/next-image/next.config.ts
+++ b/templates/next-image/next.config.ts
@@ -2,6 +2,11 @@ import type { NextConfig } from 'next';
 
 const nextConfig: NextConfig = {
   transpilePackages: ['@merit-systems/echo-next-sdk'],
+  experimental: {
+    serverActions: {
+      bodySizeLimit: '4mb',
+    },
+  },
 };
 
 export default nextConfig;
diff --git a/templates/next-image/src/app/api/edit-image/route.ts b/templates/next-image/src/app/api/edit-image/route.ts
index 11c52b38..eb619a5f 100644
--- a/templates/next-image/src/app/api/edit-image/route.ts
+++ b/templates/next-image/src/app/api/edit-image/route.ts
@@ -17,14 +17,6 @@ const providers = {
   gemini: handleGoogleEdit,
 };
 
-export const config = {
-  api: {
-    bodyParser: {
-      sizeLimit: '4mb',
-    },
-  },
-};
-
 export async function POST(req: Request) {
   try {
     const body = await req.json();

Analysis

Invalid bodyParser configuration in App Router route handler

What fails: The export const config with bodyParser.sizeLimit in templates/next-image/src/app/api/edit-image/route.ts is silently ignored in Next.js App Router, leaving the 4MB body size limit unenforced.

How to reproduce:

# Check Next.js version and App Router structure:
cd templates/next-image && cat package.json | grep '"next"'  # Shows Next.js 15.4.7
ls src/app/api/edit-image/  # Shows App Router structure

Result: The export const config from Pages Router API (pages/api/) does not work in App Router (src/app/api/). Body size limits are not enforced, potentially allowing requests larger than intended 4MB limit.

Expected: In App Router, body size limits should be configured globally via experimental.serverActions.bodySizeLimit in next.config.ts per Next.js App Router discussions and official documentation.

Comment on lines +22 to +28
export const config = {
api: {
bodyParser: {
sizeLimit: '4mb',
},
},
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
export const config = {
api: {
bodyParser: {
sizeLimit: '4mb',
},
},
};
// Note: export const config is not supported in App Router.
// Body size limits should be handled through server configuration or middleware.
// The default Next.js body size limit (1MB) applies to this route.

The export const config with bodyParser configuration is incompatible with Next.js App Router and will be ignored.

View Details

Analysis

export const config with bodyParser ignored in App Router route handler

What fails: templates/next-image/src/app/api/generate-image/route.ts uses export const config = { api: { bodyParser: { sizeLimit: '4mb' } } } which is incompatible with Next.js App Router and silently ignored

How to reproduce:

  1. Check file path: src/app/api/ structure indicates App Router
  2. Configuration uses Pages Router syntax documented only for pages/api/ routes
  3. Body size limit not enforced - requests default to 1MB limit instead of intended 4MB

Result: The 4MB size limit configuration is silently ignored, potentially causing failures for large image generation requests that exceed the default 1MB limit

Expected: App Router Route Handlers don't support export const config per Next.js App Router migration docs and GitHub issue #57501 - body limits must be configured at server/middleware level

@railway-app railway-app bot temporarily deployed to echo (echo / staging) October 17, 2025 19:11 Inactive
feat: refund failed x402 Sora 2 video gen
@railway-app railway-app bot temporarily deployed to echo (echo / staging) October 17, 2025 19:27 Inactive
@vercel vercel bot temporarily deployed to Production – component-registry October 17, 2025 19:27 Inactive
@rsproule rsproule merged commit d55e4ff into production Oct 17, 2025
22 of 23 checks passed
@railway-app railway-app bot temporarily deployed to patient-commitment (echo / production) October 19, 2025 16:36 Inactive
@railway-app railway-app bot temporarily deployed to respectful-analysis (echo / staging) October 19, 2025 17:09 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants