Files
Jiachi LiuandGitHub 5fffc9bd76 [metadata] always serve streaming metadata in build (#77437)
### What

During the export phase in next build, we always enable the streaming metadata since if there's any dynamic access in metadata we can determine it in the build phase. If it's static, then it won't affect anything. If it's dynamic, then it can be handled when request hits the route.

### Why

We want it enabled even during build b/c this is how we will enforce DIO rules without making any dynamic metadata automatically a build failure
2025-03-24 10:56:57 -07:00

28 lines
568 B
TypeScript

import { Suspense } from 'react'
import { connection } from 'next/server'
export default function Page() {
return (
<div>
inner static page
<Suspense>
<Inner />
</Suspense>
</div>
)
}
async function Inner() {
await new Promise((resolve) => setTimeout(resolve, 500))
return <div>inner</div>
}
export async function generateMetadata() {
await new Promise((resolve) => setTimeout(resolve, 1 * 1000))
await connection()
return {
title: 'partial static page',
description: 'partial static page description',
}
}