-
Notifications
You must be signed in to change notification settings - Fork 41
[Release] Hotfix - OpenRouter auto negative pricing #564
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
fix: Next-Image template
|
🚅 Deployed to the echo-pr-564 environment in echo
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| export const config = { | ||
| api: { | ||
| bodyParser: { | ||
| sizeLimit: '4mb', | ||
| }, | ||
| }, | ||
| }; |
There was a problem hiding this comment.
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 structureResult: 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.
| export const config = { | ||
| api: { | ||
| bodyParser: { | ||
| sizeLimit: '4mb', | ||
| }, | ||
| }, | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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:
- Check file path:
src/app/api/structure indicates App Router - Configuration uses Pages Router syntax documented only for
pages/api/routes - 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
Groq Provider + Smoke test + update sdks
feat: refund failed x402 Sora 2 video gen
No description provided.