[PR #492] [MERGED] fix: call reportRequestError in Pages Router prod entry #614

Closed
opened 2026-05-06 13:09:05 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/cloudflare/vinext/pull/492
Author: @NathanDrake2406
Created: 3/12/2026
Status: Merged
Merged: 3/12/2026
Merged by: @james-elicx

Base: mainHead: fix/pages-router-prod-report-request-error


📝 Commits (2)

  • e1cfb1b fix: call reportRequestError in Pages Router prod entry
  • 6305a84 fix: use original URL path in SSR error report, not locale-stripped

📊 Changes

3 files changed (+32 additions, -0 deletions)

View changed files

📝 packages/vinext/src/entries/pages-server-entry.ts (+11 -0)
📝 tests/__snapshots__/entry-templates.test.ts.snap (+11 -0)
📝 tests/entry-templates.test.ts (+10 -0)

📄 Description

Summary

  • Pages Router production (pages-server-entry.ts) was missing reportRequestError() calls in the SSR and API catch blocks
  • Dev (dev-server.ts, api-handler.ts) and App Router prod (app-rsc-entry.ts) both report errors via the instrumentation hook, but Pages Router prod only logged to console and returned 500
  • This meant instrumentation hooks like Sentry's onRequestError silently stopped firing in Pages Router production

Adds _reportRequestError() calls to both catch blocks with the same {path, method, headers} request shape and {routerKind, routePath, routeType} context shape as dev, with .catch() to swallow reporter errors (matching dev behavior).

Test plan

  • Added targeted assertion in entry-templates.test.ts that generated server entry contains reportRequestError with correct route types ("render" for SSR, "route" for API)
  • Snapshot updated to reflect new generated code
  • tests/instrumentation.test.ts passes (177 tests)
  • tests/pages-router.test.ts passes
  • CI: full Vitest + Playwright E2E suite

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/cloudflare/vinext/pull/492 **Author:** [@NathanDrake2406](https://github.com/NathanDrake2406) **Created:** 3/12/2026 **Status:** ✅ Merged **Merged:** 3/12/2026 **Merged by:** [@james-elicx](https://github.com/james-elicx) **Base:** `main` ← **Head:** `fix/pages-router-prod-report-request-error` --- ### 📝 Commits (2) - [`e1cfb1b`](https://github.com/cloudflare/vinext/commit/e1cfb1bbaa02d7f3fc094415dcd530ff55cd543f) fix: call reportRequestError in Pages Router prod entry - [`6305a84`](https://github.com/cloudflare/vinext/commit/6305a844beaedf13c280a9666de99cf05125f4b1) fix: use original URL path in SSR error report, not locale-stripped ### 📊 Changes **3 files changed** (+32 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `packages/vinext/src/entries/pages-server-entry.ts` (+11 -0) 📝 `tests/__snapshots__/entry-templates.test.ts.snap` (+11 -0) 📝 `tests/entry-templates.test.ts` (+10 -0) </details> ### 📄 Description ## Summary - Pages Router production (`pages-server-entry.ts`) was missing `reportRequestError()` calls in the SSR and API catch blocks - Dev (`dev-server.ts`, `api-handler.ts`) and App Router prod (`app-rsc-entry.ts`) both report errors via the instrumentation hook, but Pages Router prod only logged to console and returned 500 - This meant instrumentation hooks like Sentry's `onRequestError` silently stopped firing in Pages Router production Adds `_reportRequestError()` calls to both catch blocks with the same `{path, method, headers}` request shape and `{routerKind, routePath, routeType}` context shape as dev, with `.catch()` to swallow reporter errors (matching dev behavior). ## Test plan - [x] Added targeted assertion in `entry-templates.test.ts` that generated server entry contains `reportRequestError` with correct route types (`"render"` for SSR, `"route"` for API) - [x] Snapshot updated to reflect new generated code - [x] `tests/instrumentation.test.ts` passes (177 tests) - [x] `tests/pages-router.test.ts` passes - [ ] CI: full Vitest + Playwright E2E suite --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-06 13:09:05 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vinext#614
No description provided.