{{ message }}
Repository navigation
fix(metadata): accept a single openGraph video or audio entry like Next.js - #4143
Merged
james-elicx merged 4 commits intoOct 22, 2026
Merged
james-elicx merged 4 commits into
james-elicx merged 4 commits into
Conversation
Next.js renders og:video and og:audio URLs verbatim instead of resolving them against metadataBase. Cover single entries, lists, URL objects and descriptor fields with fixture pages in the Next.js compat metadata suite.
Member
|
/bigbonk review for issues |
@vinext/cloudflare
create-vinext-app
@vinext/types
vinext
@cloudflare/workers-response-store
commit: |
Contributor
|
LGTM! |
Contributor
Performance benchmarksCompared 0 improved · 0 regressed · 7 within ±1.5% View detailed results and traces 🟢 improvement · 🔴 regression · ⚫ change below 1.5% · paired base/head |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
MetadataHeaditeratesopenGraph.videosandopenGraph.audioas arrays of descriptors. Next.js types both fields asOGVideo | Array<OGVideo>andOGAudio | Array<OGAudio>, where each entry is a URL string, aURL, or a descriptor. As a result:videos: { url: "https://example.com/v.mp4" }throwsTypeError: og.videos is not iterable, so the page fails to render.audio: "https://example.com/a.mp3"iterates the string's characters and emits one emptyog:audiotag per character.og:video/og:audiotags without content.secureUrlandtypeare dropped, soog:video:secure_url,og:video:type,og:audio:secure_urlandog:audio:typenever render.metadataBase. Next.js renders them as written (String(url)); only images go throughmetadataBase.This change normalizes both fields with the existing
normalizeUrlDescriptorEntrieshelper (already used for icons), renders the URLs as written, and emitssecure_urlandtypein the same order as Next.js'smetadata.tsx. Descriptors without aurlskip theog:video/og:audiotag, as in Next.js.Expected output was captured from a real next@16.2.7 build serving the same metadata:
videos: { url: "/v.mp4", ... }withmetadataBase: new URL("https://base.example.com")rendersog:videoas/v.mp4, andURLentries render their href.Test plan
tests/fixtures/app-basic/app/nextjs-compat/metadata-opengraph-video-audio(single descriptor + single string) and.../list(strings,URLs and descriptors), both with ametadataBase.tests/nextjs-compat/metadata.test.tsassert the exact orderedog:video*/og:audio*tags Next.js renders.main(og.videos is not iterable) and on the earlier revision of this PR (URLs absolutized againstmetadataBase); both pass now.vp checkpasses.Fixes #4142