Skip to content

Commit

Permalink
Clarify that streaming is blocked on generateMetadata for initial load (
Browse files Browse the repository at this point in the history
#71985)

The initial load, `generateMetadata` needs to block the streaming for 2
reasons:

1. You want the ability to respond the HTML with special status code
based on the `notFound` / `redirect` call inside `generateMetadata`. You
cannot do that in out-of-order streaming, hence blocking the streaming.
2. SEO
  • Loading branch information
gaojude authored and kdy1 committed Oct 30, 2024
1 parent b9a5083 commit e07fad9
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export async function generateMetadata({ params }) {
>
> - The `metadata` object and `generateMetadata` function exports are **only supported in Server Components**.
> - You cannot export both the `metadata` object and `generateMetadata` function from the same route segment.
> - On the initial load, streaming is blocked until `generateMetadata` has fully resolved, including any content from `loading.js`.
## The `metadata` object

Expand Down

0 comments on commit e07fad9

Please sign in to comment.