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
When a getServerSideProps function mutates res (for example by setting headers) after it has returned, vinext renders the page with pageProps: {} instead of the actual returned props. The asynchronous mutation appears to race with prop serialisation and overwrite the response.
Pages Router gssp that mutates res after returning the props object loses the props
Estimated Impact
~2 test failures across the deploy suite.
Affected Test Suites
test/e2e/getserversideprops/test/index.test.ts (2 failures)
Recommendation
-
Reproduce first in vinext's own test suite. Add a Pages Router page where gssp calls setTimeout(() => res.setHeader(...)) after returning. Assert the response still contains the originally-returned pageProps.
-
Snapshot props before allowing res mutation. Once gssp returns, the props payload should be committed to the response body / __NEXT_DATA__ before any subsequent async res mutation can alter the headers.
-
Treat post-return mutation as a no-op for the body. Mirror Next.js behaviour where headers set after the response has begun are dropped, but the rendered body remains intact.
Problem
When a
getServerSidePropsfunction mutatesres(for example by setting headers) after it has returned, vinext renders the page withpageProps: {}instead of the actual returned props. The asynchronous mutation appears to race with prop serialisation and overwrite the response.Estimated Impact
~2 test failures across the deploy suite.
Affected Test Suites
test/e2e/getserversideprops/test/index.test.ts(2 failures)Recommendation
Reproduce first in vinext's own test suite. Add a Pages Router page where gssp calls
setTimeout(() => res.setHeader(...))after returning. Assert the response still contains the originally-returnedpageProps.Snapshot props before allowing
resmutation. Once gssp returns, the props payload should be committed to the response body /__NEXT_DATA__before any subsequent asyncresmutation can alter the headers.Treat post-return mutation as a no-op for the body. Mirror Next.js behaviour where headers set after the response has begun are dropped, but the rendered body remains intact.