-
Notifications
You must be signed in to change notification settings - Fork 29.9k
docs: fix generateImageMetadata example to use normal params object #85658
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
docs: fix generateImageMetadata example to use normal params object #85658
Conversation
|
Allow CI Workflow Run
Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer |
dschafer
left a comment
There was a problem hiding this 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.
|
You’re right @dschafer both examples are synchronous. I’ve kept |
icyJoseph
left a comment
There was a problem hiding this 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
…85658) ### 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: ```ts 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' }] } --------- Co-authored-by: Joseph <joseph.chamochumbi@vercel.com>
…85658) ### 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: ```ts 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' }] } --------- Co-authored-by: Joseph <joseph.chamochumbi@vercel.com>
What?
Fixes an inconsistency in the v16 upgrade documentation for
generateImageMetadata.Why?
In the “Upgrading to Version 16” guide, the example incorrectly awaited the
paramsobject insidegenerateImageMetadata, implying that it was a Promise.However, according to the API reference,
paramsis a normal object. This PR updates the example to reflect the correct synchronous usage.How?
Replaced: