Files
Josh StoryandGitHub d424aa8ec4 Stabilize unstable_instant (#94578)
This API has experimental modes for build validation but the dev
validation is going to be stable in the next release.
2026-06-09 13:50:25 -07:00

33 lines
694 B
TypeScript

import { Metadata } from 'next'
import { cookies } from 'next/headers'
import { Suspense } from 'react'
export const instant = { level: 'experimental-error' }
export async function generateMetadata(): Promise<Metadata> {
await cookies()
return {
title: 'Blocked by cookies',
}
}
export default function Page() {
return (
<main>
<p>This page has a generateMetadata that accesses cookies.</p>
<p>
We also access cookies in the page itself, because a static page with
non-static metadata is not allowed.
</p>
<Suspense>
<Runtime />
</Suspense>
</main>
)
}
async function Runtime() {
await cookies()
return null
}