Unverified Commit 2b05191b authored by Jude Gao's avatar Jude Gao Committed by GitHub

Clarify that streaming is blocked on generateMetadata for initial load (#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
parent 84037803
...@@ -46,6 +46,7 @@ export async function generateMetadata({ params }) { ...@@ -46,6 +46,7 @@ export async function generateMetadata({ params }) {
> >
> - The `metadata` object and `generateMetadata` function exports are **only supported in Server Components**. > - 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. > - 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 ## The `metadata` object
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment