mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #97] [MERGED] fix: sanitize error messages in production mode #307
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#307
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?
📋 Pull Request Information
Original PR: https://github.com/cloudflare/vinext/pull/97
Author: @southpolesteve
Created: 2/26/2026
Status: ✅ Merged
Merged: 2/26/2026
Merged by: @southpolesteve
Base:
main← Head:fix/sanitize-error-messages📝 Commits (1)
a4c3cf6fix: sanitize error messages in production mode📊 Changes
7 files changed (+99 additions, -23 deletions)
View changed files
📝
examples/hackernews/worker/index.ts(+1 -4)📝
examples/pages-router-cloudflare/worker/index.ts(+1 -4)📝
examples/realworld-api-rest/worker/index.ts(+1 -4)📝
packages/vinext/src/server/api-handler.ts(+2 -1)📝
packages/vinext/src/server/app-dev-server.ts(+82 -5)📝
packages/vinext/src/server/dev-server.ts(+7 -4)📝
packages/vinext/src/server/middleware.ts(+5 -1)📄 Description
Summary
Returns generic error messages in production responses instead of raw exception details. Full errors are still logged server-side for debugging.
__sanitizeErrorForClient()replaces non-navigation errors with a generic message + djb2 digest hash (matching Next.js behavior) in production. Navigation errors (redirect, notFound, etc.) pass through unchanged with their digests intact.onErrorcallbacks generate digest hashes for non-navigation errors in production, allowing server-log correlation without exposing details to clients🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.