When generateMetadata performs an asynchronous action, Suspense is not being rendered until generateMetadata finish #72935
Labels
bug
Issue was opened via the bug report template.
Metadata
Related to Next.js' Metadata API.
Performance
Anything with regards to Next.js performance.
Link to the code that reproduces this issue
https://github.com/ebidrey/suspense-generate-metadata
To Reproduce
To Reproduce
You can run this simple snippet
It is also available in github repo
Current vs. Expected behavior
I expect suspense fallback to be activated immediately when the page request is made and then, the page and the metadata get streamed. Instead, page stucks for the amount of time the request to the api takes, showing nothing up to the request finished, degradating the user experience and not improving SEO in any way.
Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 23.0.0: Fri Sep 15 14:41:43 PDT 2023; root:xnu-10002.1.13~1/RELEASE_ARM64_T6000 Available memory (MB): 16384 Available CPU cores: 10 Binaries: Node: 20.9.0 npm: 10.1.0 Yarn: 1.22.10 pnpm: N/A Relevant Packages: next: 15.0.4-canary.14 // Latest available version is detected (15.0.4-canary.14). eslint-config-next: 15.0.4-canary.14 react: 19.0.0-rc-380f5d67-20241113 react-dom: 19.0.0-rc-380f5d67-20241113 typescript: 5.6.3 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
Metadata, Performance
Which stage(s) are affected? (Select all that apply)
next dev (local), next build (local), next start (local), Vercel (Deployed), Other (Deployed)
Additional context
Tested in latest canary and stable.
The text was updated successfully, but these errors were encountered: