mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[GH-ISSUE #963] getMetadataRouteSuffix only exempts sitemap; metadataRouteSuffix also exempts robots and manifest #209
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#209
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 @Divkix on GitHub (Apr 29, 2026).
Original GitHub issue: https://github.com/cloudflare/vinext/issues/963
Identified during review of #946.
Context
getMetadataRouteSuffix(static metadata URL resolution) only exemptssitemapfrom hash suffixes, while the existingmetadataRouteSuffix(dynamic metadata URL resolution) exemptssitemap,robots, andmanifest.This is inconsequential today because
robotsandmanifestarenestable: false(so they only appear at root, where there are no invisible parents to trigger hash suffixes). But ifnestableever changes, the two functions would disagree.Suggested approach
Add
robotsandmanifestexemptions togetMetadataRouteSuffixfor defensive consistency, or add a comment noting why only sitemap is exempted (this function is ported from Next.js where robots/manifest aren't relevant in the static path).@Divkix commented on GitHub (Apr 29, 2026):
Analysis
Compared vinext against Next.js source (
packages/next/src/lib/metadata/get-metadata-route.ts).Next.js (single function, lines 29–50)
Next.js has only one
getMetadataRouteSuffixfunction. It exempts sitemap and nothing else:There is no separate static/dynamic suffix function — Next.js uses the same function for both paths.
vinext (two functions)
vinext has two separate functions in
packages/vinext/src/server/metadata-routes.ts:getMetadataRouteSuffix()(line 396) — used for static metadata routes (fillStaticMetadataSegment). Exempts onlysitemap/sitemap.xml. Matches Next.js. ✓metadataRouteSuffix()(line 463) — used for dynamic metadata routes. Exemptssitemap,robots, andmanifest. Diverges from Next.js. ✗Verdict
nestable: false(root-only) in vinext, so invisible parent segments never apply, and the extra exemptions are never triggered.nestableever changes, the two functions would produce different suffixes for robots/manifest routes under invisible parents.Recommended Action
Align
metadataRouteSuffix()withgetMetadataRouteSuffix()and Next.js: remove therobotsandmanifestexemptions. Replace lines 463–468 with:This makes both functions match Next.js exactly and eliminates the inconsistency.