Skip to content

Conversation

huozhi
Copy link
Member

@huozhi huozhi commented Oct 3, 2025

In v6, the params argument of metadata image routes will become params, which is aligned with other page routes in App Router.
The 2nd argument id will become Promise<string> if you use generateImageMetadata

@ijjk ijjk added created-by: Next.js team PRs by the Next.js team. Documentation Related to Next.js' official documentation. labels Oct 3, 2025
```jsx filename="app/shop/[slug]/opengraph-image.js" switcher
export default function Image({ params }) {
export default async function Image({ params }) {
const { slug } = await params
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The params table shows resolved values instead of Promise-wrapped values, making it inconsistent with the code examples above it and with similar tables in other documentation files (page.mdx, layout.mdx).

View Details
📝 Patch Details
diff --git a/docs/01-app/03-api-reference/03-file-conventions/01-metadata/opengraph-image.mdx b/docs/01-app/03-api-reference/03-file-conventions/01-metadata/opengraph-image.mdx
index ecddc3aa06..a99e354982 100644
--- a/docs/01-app/03-api-reference/03-file-conventions/01-metadata/opengraph-image.mdx
+++ b/docs/01-app/03-api-reference/03-file-conventions/01-metadata/opengraph-image.mdx
@@ -240,11 +240,11 @@ export default async function Image({ params }) {
 }
 ```
 
-| Route                                      | URL         | `params`                  |
-| ------------------------------------------ | ----------- | ------------------------- |
-| `app/shop/opengraph-image.js`              | `/shop`     | `undefined`               |
-| `app/shop/[slug]/opengraph-image.js`       | `/shop/1`   | `{ slug: '1' }`           |
-| `app/shop/[tag]/[item]/opengraph-image.js` | `/shop/1/2` | `{ tag: '1', item: '2' }` |
+| Route                                      | URL         | `params`                            |
+| ------------------------------------------ | ----------- | ----------------------------------- |
+| `app/shop/opengraph-image.js`              | `/shop`     | `undefined`                         |
+| `app/shop/[slug]/opengraph-image.js`       | `/shop/1`   | `Promise<{ slug: '1' }>`            |
+| `app/shop/[tag]/[item]/opengraph-image.js` | `/shop/1/2` | `Promise<{ tag: '1', item: '2' }>` |
 
 ### Returns
 

Analysis

Inconsistent params table in opengraph-image.mdx shows resolved values instead of Promise-wrapped values

What fails: The params table in docs/01-app/03-api-reference/03-file-conventions/01-metadata/opengraph-image.mdx (lines 243-247) shows params values as plain objects ({ slug: '1' }) instead of Promise-wrapped values (Promise<{ slug: '1' }>), contradicting the prose description, TypeScript types, and code examples in the same file.

How to verify: Compare the params tables across documentation files:

  • page.mdx line 59: app/shop/[slug]/page.jsPromise<{ slug: '1' }>
  • layout.mdx line 82: app/dashboard/[team]/layout.jsPromise<{ team: '1' }>
  • opengraph-image.mdx line 246 (before fix): app/shop/[slug]/opengraph-image.js{ slug: '1' }

Result: The table incorrectly suggests params contains the resolved object directly, contradicting:

  • Line 223: "A promise that resolves to an object"
  • Line 229: TypeScript type params: Promise<{ slug: string }>
  • Lines 231, 238: Code examples using await params

Expected: The params table should match the pattern used in page.mdx and layout.mdx, showing Promise<{ slug: '1' }> to maintain consistency across all API reference documentation for the Next.js 15 params promise migration.

@huozhi huozhi marked this pull request as ready for review October 3, 2025 14:29
@huozhi huozhi requested a review from icyJoseph October 3, 2025 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
created-by: Next.js team PRs by the Next.js team. Documentation Related to Next.js' official documentation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants