mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #784] [MERGED] fix: move NotFoundBoundary inside Template in per-segment wiring #844
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#844
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/784
Author: @NathanDrake2406
Created: 4/5/2026
Status: ✅ Merged
Merged: 4/5/2026
Merged by: @james-elicx
Base:
main← Head:fix/notfound-inside-template📝 Commits (2)
20519bbtest: assert not-found fallback renders inside template88c0e29fix: move NotFoundBoundary inside Template in per-segment wiring📊 Changes
2 files changed (+103 additions, -10 deletions)
View changed files
📝
packages/vinext/src/server/app-page-route-wiring.tsx(+11 -10)📝
tests/app-page-route-wiring.test.ts(+92 -0)📄 Description
Summary
NotFoundBoundarywas placed outsideTemplatein the per-segment layout loop, producingLayout > NotFound > Template > Error > PageTemplateContext— the correct order isLayout > Template > Error > NotFound > PagenotFound()fired, the NotFound fallback replaced the entire Template subtree instead of rendering inside itMoves the
layoutNotFoundComponentwrapping to the top of the loop body (beforeErrorBoundary), making it the innermost wrapper. Since the loop builds bottom-up, this produces the correct outer-to-inner nesting.This is a pre-existing bug surfaced by the comment introduced in #780.
Test plan
NotFoundBoundary is nested inside Template) walks the React element tree and assertsRootTemplateappears at a shallower depth thanNotFoundBoundaryInnertests/app-page-route-wiring.test.tspass after fixvp checkpasses with no type errors🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.