Pages Router: `getServerSideProps` SSR returns 500 Internal Server Error
#1,458 opened on May 22, 2026
Repository metrics
- Stars
- (8,563 stars)
- PR merge metrics
- (Avg merge 1d 1h) (462 merged PRs in 30d)
Description
This issue was created by an agent analysing CI failures from the Next.js Deploy Suite (vinext
mainvs Next.jsv16.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
-
Reproduce first in vinext's own test suite. Add a Pages Router page with a simple
getServerSidePropsreturning{ props: { post } }. Confirm the response is 500. -
Inspect the server logs. Look for the stack trace produced by the 500 response — it should pinpoint the gssp dispatch path that is crashing.
-
Fix the gssp dispatch path. Make sure
getServerSidePropsis invoked with the correct context (req/res/query/params), its props serialised, and the error path handed to the user's custompages/500.tsxrather than collapsed into a plainInternal Server Error.