cloudflare/vinext

Pages Router: `getServerSideProps` SSR returns 500 Internal Server Error

已关闭

#1,458 创建于 2026年5月22日

 (0 条评论) (0 个反应) (0 位负责人)TypeScript (371 个派生)github user discovery
adapter-api-e2ehelp wanted

仓库指标

星标
 (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 main vs Next.js v16.2.6, 2026-05-22).

Problem

Several Pages Router pages that should SSR via getServerSideProps respond with Internal Server Error (HTTP 500) instead of the rendered page. The data-fetching pipeline appears to crash on basic gssp pages and on error-mapping cases (ENOENT, thrown errors), preventing the custom pages/500.tsx from rendering.

Expected pattern: /Post:.*?post-1/
Received: "Internal Server Error"
Expected substring: "custom pages/500"
Received: "Internal Server Error"

Estimated Impact

~3 test failures across the deploy suite.

Affected Test Suites

  • test/e2e/getserversideprops/test/index.test.ts (3 failures)

Recommendation

  1. Reproduce first in vinext's own test suite. Add a Pages Router page with a simple getServerSideProps returning { props: { post } }. Confirm the response is 500.

  2. Inspect the server logs. Look for the stack trace produced by the 500 response — it should pinpoint the gssp dispatch path that is crashing.

  3. Fix the gssp dispatch path. Make sure getServerSideProps is invoked with the correct context (req/res/query/params), its props serialised, and the error path handed to the user's custom pages/500.tsx rather than collapsed into a plain Internal Server Error.

贡献者指南