Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: #68259 set authors in openGraph of metadata to empty string will be crash with SSR #68151

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/next/src/lib/metadata/generate/meta.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ export function MultiMeta({
if (typeof contents === 'undefined' || contents === null) {
return null
}
if (!Array.isArray(contents)) {
contents = [contents]
}

return MetaFilter(
contents.map((content) => {
Expand Down
5 changes: 5 additions & 0 deletions packages/next/src/lib/metadata/resolvers/resolve-opengraph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,11 @@ export const resolveOpenGraph: FieldResolverExtraArgs<
)
}

/*
warning: force type assertion maybe merge authors of openGraph with string type from Metadata into ResolvedOpenGraph,
but it's not support a string type for authors of openGraph.
is there any other field that has the same issue?
*/
const resolved = {
...openGraph,
title: resolveTitle(openGraph.title, titleTemplate),
Expand Down
Loading