next.js
9cb20484 - Ensure app-page reports stale ISR revalidation errors via onRequestError (#92282)

Commit
19 days ago
Ensure app-page reports stale ISR revalidation errors via onRequestError (#92282) Note: the change is mostly whitespace. Recommend reviewing w/o whitespace [here](https://github.com/vercel/next.js/pull/92282/changes?w=1). For App Router pages using time-based ISR, a stale cached response can be returned before background revalidation finishes. If that background revalidation later throws, the error does not bubble back through the normal top-level `app-page` request catch. Instead, the response cache has already resolved the request and later logs the failure internally. When an error happens while rendering an app router page, and the entry is stale, we now explicitly await `routeModule.onRequestError(...)` before rethrowing. This copies similar handling in pages router: https://github.com/vercel/next.js/blob/daca04d09bf9aaee9e1c63324166985b643e9844/packages/next/src/server/route-modules/pages/pages-handler.ts#L438-L460 and route handlers: https://github.com/vercel/next.js/blob/daca04d09bf9aaee9e1c63324166985b643e9844/packages/next/src/build/templates/app-route.ts#L407-L409
Author
Parents
Loading