Quest for Codev2.0.0
/
SIGN IN
next.js/test/e2e/app-dir/instant-validation/app/suspense-in-root/runtime/invalid-sync-io-in-runtime-with-valid-static-parent/page.tsx
page.tsx19 lines527 B
import { cookies } from 'next/headers'

export const unstable_instant = true
export const unstable_prefetch = 'force-runtime'

// This page HAS runtime prefetch enabled. The sync IO (Date.now()) after
// cookies() is invalid here because during a runtime prefetch, cookies()
// resolves and then Date.now() would abort the prerender too early.

export default async function Page() {
  await cookies()
  const now = Date.now()
  return (
    <main>
      <p>Runtime page with sync IO after cookies: {now}</p>
    </main>
  )
}