倉庫指標
- 星標
- (8,563 顆星)
- PR 合併指標
- (平均合併 1天 1小時) (30 天內合併 462 個 PR)
描述
This issue was created by an agent analysing CI failures from the Next.js Deploy Suite (vinext
mainvs Next.jsv16.2.6, 2026-05-20).
Problem
Edge runtime API routes in the Pages Router return 500 errors. Pages Router API routes using ImageResponse (OG image generation) return 404. App Router OG image routes with custom fonts return 500.
Expected: 200
Received: 500 // /api/hello (edge API route)
Expected: 200
Received: 404 // /api/og (Pages Router ImageResponse)
Expected: 200
Received: 500 // /font/opengraph-image (custom font OG)
Estimated Impact
~15 test failures across the deploy suite.
Affected Test Suites
test/e2e/edge-pages-support/index.test.ts(2 failures)test/e2e/og-api/index.test.ts(1 failure)test/e2e/app-dir/metadata-font/metadata-font.test.ts(1 failure)test/e2e/edge-pages-support/edge-document.test.tstest/e2e/edge-runtime-node-compatibility/edge-runtime-node-compatibility.test.tstest/e2e/streaming-ssr-edge/*.test.tstest/e2e/edge-compiler-can-import-blob-assets/*.test.ts
Recommendation
-
Reproduce first in vinext's own test suite. Add a test with a Pages Router edge API route (
export const runtime = 'edge') and verify it returns a proper response. Add a test for an OG image route handler. Confirm they fail. -
Study how vinext handles edge runtime routes. The edge runtime environment may not be properly set up for
pages/api/*routes in the production server. -
Fix Pages Router API route matching for edge runtime. Ensure
pages/api/*routes withexport const runtime = 'edge'are properly detected and executed. -
Fix OG image route handling. Ensure
ImageResponsefromnext/ogworks in both Pages Router API routes and App Router metadata routes. Custom font loading (fetch()for font files) may need special handling in the Cloudflare Workers environment.