Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@marjan-ahmed
Copy link
Contributor

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' }]
}

@ijjk ijjk added the Documentation Related to Next.js' official documentation. label Nov 1, 2025
@ijjk
Copy link
Member

ijjk commented Nov 1, 2025

Allow CI Workflow Run

  • approve CI run for commit: dccc1d0

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

Copy link

@dschafer dschafer left a comment

Choose a reason for hiding this comment

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

Thanks for the quick PR for #85656 !

I do think there are probably some additional changes needed to make sure the documentation flows reasonably here. If generateImageMetadata gets params synchronously in both v15 and v16, we probably just shouldn’t mention it at all in this migration guide, right?

But I’ll defer to the maintainers on that one.

@marjan-ahmed
Copy link
Contributor Author

You’re right @dschafer both examples are synchronous. I’ve kept generateImageMetadata as is and clarified that only the Image function uses async props.

Copy link
Collaborator

@icyJoseph icyJoseph left a comment

Choose a reason for hiding this comment

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

Thanks for the PR

@icyJoseph icyJoseph merged commit b350da4 into vercel:canary Nov 3, 2025
63 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation Related to Next.js' official documentation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants