Commit 9cb2048
authored
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-L4091 parent 678a4aa commit 9cb2048
1 file changed
Lines changed: 373 additions & 349 deletions
0 commit comments