next.js/test/e2e/app-dir/use-cache/app/(partially-static)/unhandled-promise-regression/layout.tsx
layout.tsx34 lines684 B
import { Suspense } from 'react'
import { cookies, headers } from 'next/headers'
import { connection } from 'next/server'

export const metadata = {
  title: 'Next.js',
  description: 'Generated by Next.js',
}

export default function RootLayout({
  children,
}: {
  children: React.ReactNode
}) {
  return (
    <html lang="en">
      <body>
        {children}
        <Suspense>
          <HangingCalls />
        </Suspense>
      </body>
    </html>
  )
}

async function HangingCalls() {
  // We purposely do not await these to prevent React from suppressing the rejection error
  cookies().then(() => {})
  headers().then(() => {})
  connection().then(() => {})
  return null
}
Quest for Codev2.0.0
/
SIGN IN