mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[GH-ISSUE #775] Report errors from stale ISR background revalidation via onRequestError #169
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#169
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @github-actions[bot] on GitHub (Apr 4, 2026).
Original GitHub issue: https://github.com/cloudflare/vinext/issues/775
Next.js Change
Next.js now reports errors that occur during background ISR revalidation of stale App Router pages via
routeModule.onRequestError(). Previously, when a stale cached response was returned and the background revalidation threw an error, that error was swallowed silently (only logged internally by the response cache).Commit:
9cb2048PR: #92282
What Changed
In
packages/next/src/build/templates/app-page.ts, the response generator function body is now wrapped in atry/catch. WhenpreviousIncrementalCacheEntry?.isStaleis truthy and the render throws, the error is reported viarouteModule.onRequestError()before being rethrown. This ensures instrumentation hooks (e.g., Sentry, OpenTelemetry) see the error even though the user already got a stale response.This mirrors existing behavior in Pages Router (
pages-handler.ts) and Route Handlers (app-route.ts).Impact on vinext
vinext has its own ISR implementation in
isr-cache.tsandserver/modules. If vinext's ISR serves a stale response while triggering background revalidation, errors during that revalidation should also be surfaced — not silently swallowed. This is important for:Suggested Action