nextjs - ✅(Solved) Fix Docs: V16 generateImageMetadata inconsistency [1 pull requests, 5 comments, 4 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vercel/next.js#85656Fetched 2026-04-08 02:14:41
View on GitHub
Comments
5
Participants
4
Timeline
16
Reactions
0
Author
Timeline (top)
commented ×5mentioned ×3subscribed ×3closed ×1

Fix Action

Fixed

PR fix notes

PR #85658: docs: fix generateImageMetadata example to use normal params object

Description (problem / solution / changelog)

What?

Fixes an inconsistency in the v16 upgrade documentation for generateImageMetadata.

Why?

In the “Upgrading to Version 16” guide, the example incorrectly awaited the params object inside generateImageMetadata, implying that it was a Promise.
However, according to the API reference, params is a normal object. This PR updates the example to reflect the correct synchronous usage.

How?

Replaced:

export async function generateImageMetadata({ params }) {
  const { slug } = await params
  return [{ id: '1' }, { id: '2' }]
}

With
```ts
export async function generateImageMetadata({ params }) {
  // params is a normal object
  return [{ id: '1' }, { id: '2' }]
}

## Changed files

- `docs/01-app/02-guides/upgrading/version-16.mdx` (modified, +2/-3)
RAW_BUFFERClick to expand / collapse

What is the documentation issue?

In the “Upgrading to Version 16” docs describing changes to OG Image generation, both generateImageMetadata and the image generation function are said to now receive promises as their inputs:

https://github.com/vercel/next.js/blob/8c263a9ed42da37bc9c1745890f21a6c46034438/docs/01-app/02-guides/upgrading/version-16.mdx?plain=1#L329-L332

However, there doesn’t appear to be any other place where generateImageMetadata is described as now taking a promise; in particular, the API reference for that function says it gets the values synchronously:

https://github.com/vercel/next.js/blob/8c263a9ed42da37bc9c1745890f21a6c46034438/docs/01-app/03-api-reference/04-functions/generate-image-metadata.mdx?plain=1#L22-L28

Not sure which of these is correct (I think it’s the latter, but I’m not sure), but they are currently inconsistent.

Is there any context that might help us understand?

The above should be comprehensive.

Does the docs page already exist? Please link to it.

https://nextjs.org/docs/app/guides/upgrading/version-16

extent analysis

TL;DR

The documentation inconsistency regarding generateImageMetadata input type should be resolved by verifying the actual function behavior and updating the documentation accordingly.

Guidance

  • Review the implementation of generateImageMetadata to determine if it indeed accepts promises as inputs or if it expects synchronous values.
  • Compare the documentation in "Upgrading to Version 16" with the API reference for generateImageMetadata to identify the inconsistency.
  • Verify the behavior of generateImageMetadata through testing or code inspection to confirm whether it supports promises or synchronous values.
  • Update the documentation to reflect the correct input type for generateImageMetadata, ensuring consistency across all relevant documents.

Notes

The resolution of this issue relies on accurately determining the behavior of generateImageMetadata. Without access to the implementation details or further context, it's crucial to test or inspect the code to make an informed decision.

Recommendation

Apply workaround: Update the documentation to reflect the correct input type for generateImageMetadata based on verified behavior, ensuring consistency and accuracy in the documentation.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING