mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
### What?
The string value of `Metadata.openGraph.emails` throws error:
```tsx
export const metadata = {
openGraph: {
type: 'article',
emails: '[email protected]',
},
};
```
Error:
```sh
r.map is not a function
```
The type is:
```tsx
type OpenGraphMetadata = {
// ...
emails?: string | Array<string>
}
```
### Why?
Basic values such as `emails` and `phoneNumbers` were not included when
`ogType` was set while resolving the values.
### How?
Include basic values when resolving the metadata.
Fixes #63415
20 lines
534 B
TypeScript
20 lines
534 B
TypeScript
import type { Metadata } from 'next'
|
|
|
|
export default function Layout({ children }) {
|
|
return children
|
|
}
|
|
|
|
export const metadata = {
|
|
openGraph: {
|
|
title: 'Layout open graph title',
|
|
description: 'My custom description',
|
|
type: 'article',
|
|
publishedTime: '2023-01-01T00:00:00.000Z',
|
|
authors: ['author1', 'author2', 'author3'],
|
|
images: new URL('https://example.com/og-image.jpg'),
|
|
emails: '[email protected]',
|
|
phoneNumbers: '1234567890',
|
|
faxNumbers: '1234567890',
|
|
} satisfies Metadata['openGraph'],
|
|
}
|