Files
Niklas Mischkulnig 93249ee06d Fix Pages router 404 runtime rendering with Adapter (#95264)
The problem is that the adapter expected a `output.pages` for the `/404`
route so that it can add these files to other Pages handlers so that
they can render a 404 at runtime (getStaticProps with
revaliate/getServerSideProps):


https://github.com/nextjs/adapter-vercel/blob/650effd340b4f676a9bca6e0cdaba9bf7d34595a/packages/adapter/src/outputs.ts#L421-L438

https://github.com/nextjs/adapter-vercel/blob/650effd340b4f676a9bca6e0cdaba9bf7d34595a/packages/adapter/src/node-handler.ts#L331-L340

But this 404 Pages handler was not actually emitted if it was
prerendered, where it only emitted the `/404.html` static file. But
that's not what the adapter needs.

Tests:
1. Run as an e2e test
2. Add a variant with dynamically rendered 404 pages

Full e2e test run:
~~https://github.com/vercel/next.js/actions/runs/29081105397~~
https://github.com/vercel/next.js/actions/runs/29087851475

Closes NEXT-4947
2026-07-13 09:56:16 +02:00
..
…