Unverified Commit a28160a8 authored by Hendrik Liebau's avatar Hendrik Liebau Committed by GitHub

Dynamic IO: Improve error handling (#73607)

This PR improves error handling when `dynamicIO` is enabled.

- prevents well-known errors from being logged
- avoids unhandled rejections being logged during prerendering in dev
mode
- avoids hanging responses when well-known or unexpected errors are
thrown
- ensures pages with `notFound` used in the top level can be prerendered
statically

addresses
https://github.com/vercel/next.js/pull/73210#issuecomment-2515179765
closes NAR-48
parent 36b4e300
...@@ -80,6 +80,7 @@ import { ...@@ -80,6 +80,7 @@ import {
createHTMLErrorHandler, createHTMLErrorHandler,
type DigestedError, type DigestedError,
isUserLandError, isUserLandError,
getDigestForWellKnownError,
} from './create-error-handler' } from './create-error-handler'
import { import {
getShortDynamicParamType, getShortDynamicParamType,
...@@ -152,6 +153,7 @@ import { getRevalidateReason } from '../instrumentation/utils' ...@@ -152,6 +153,7 @@ import { getRevalidateReason } from '../instrumentation/utils'
import { PAGE_SEGMENT_KEY } from '../../shared/lib/segment' import { PAGE_SEGMENT_KEY } from '../../shared/lib/segment'
import type { FallbackRouteParams } from '../request/fallback-params' import type { FallbackRouteParams } from '../request/fallback-params'
import { DynamicServerError } from '../../client/components/hooks-server-context' import { DynamicServerError } from '../../client/components/hooks-server-context'
import { ServerPrerenderStreamResult } from './app-render-prerender-utils'
import { import {
type ReactServerPrerenderResult, type ReactServerPrerenderResult,
ReactServerResult, ReactServerResult,
...@@ -570,7 +572,7 @@ async function generateDynamicFlightRenderResult( ...@@ -570,7 +572,7 @@ async function generateDynamicFlightRenderResult(
ctx.clientReferenceManifest, ctx.clientReferenceManifest,
ctx.workStore.route, ctx.workStore.route,
requestStore requestStore
) ).catch(resolveValidation) // avoid unhandled rejections and a forever hanging promise
} }
// For app dir, use the bundled version of Flight server renderer (renderToReadableStream) // For app dir, use the bundled version of Flight server renderer (renderToReadableStream)
...@@ -1693,7 +1695,7 @@ async function renderToStream( ...@@ -1693,7 +1695,7 @@ async function renderToStream(
clientReferenceManifest, clientReferenceManifest,
workStore.route, workStore.route,
requestStore requestStore
) ).catch(resolveValidation) // avoid unhandled rejections and a forever hanging promise
reactServerResult = new ReactServerResult(reactServerStream) reactServerResult = new ReactServerResult(reactServerStream)
} else { } else {
...@@ -2088,7 +2090,13 @@ async function spawnDynamicValidationInDev( ...@@ -2088,7 +2090,13 @@ async function spawnDynamicValidationInDev(
firstAttemptRSCPayload, firstAttemptRSCPayload,
clientReferenceManifest.clientModules, clientReferenceManifest.clientModules,
{ {
onError: (err: unknown) => { onError: (err) => {
const digest = getDigestForWellKnownError(err)
if (digest) {
return digest
}
if ( if (
initialServerPrerenderController.signal.aborted || initialServerPrerenderController.signal.aborted ||
initialServerRenderController.signal.aborted initialServerRenderController.signal.aborted
...@@ -2146,7 +2154,13 @@ async function spawnDynamicValidationInDev( ...@@ -2146,7 +2154,13 @@ async function spawnDynamicValidationInDev(
/>, />,
{ {
signal: initialClientController.signal, signal: initialClientController.signal,
onError: (err: unknown, _errorInfo: ErrorInfo) => { onError: (err) => {
const digest = getDigestForWellKnownError(err)
if (digest) {
return digest
}
if (initialClientController.signal.aborted) { if (initialClientController.signal.aborted) {
// These are expected errors that might error the prerender. we ignore them. // These are expected errors that might error the prerender. we ignore them.
} else if ( } else if (
...@@ -2239,12 +2253,15 @@ async function spawnDynamicValidationInDev( ...@@ -2239,12 +2253,15 @@ async function spawnDynamicValidationInDev(
finalServerPayload, finalServerPayload,
clientReferenceManifest.clientModules, clientReferenceManifest.clientModules,
{ {
onError: (err: unknown) => { onError: (err) => {
if (finalServerController.signal.aborted) { if (
if (isPrerenderInterruptedError(err)) { finalServerController.signal.aborted &&
return err.digest isPrerenderInterruptedError(err)
} ) {
return err.digest
} }
return getDigestForWellKnownError(err)
}, },
signal: finalServerController.signal, signal: finalServerController.signal,
} }
...@@ -2272,15 +2289,14 @@ async function spawnDynamicValidationInDev( ...@@ -2272,15 +2289,14 @@ async function spawnDynamicValidationInDev(
/>, />,
{ {
signal: finalClientController.signal, signal: finalClientController.signal,
onError: (err: unknown, errorInfo: ErrorInfo) => { onError: (err, errorInfo) => {
if ( if (
isPrerenderInterruptedError(err) || isPrerenderInterruptedError(err) ||
finalClientController.signal.aborted finalClientController.signal.aborted
) { ) {
requestStore.usedDynamic = true requestStore.usedDynamic = true
const componentStack: string | undefined = (errorInfo as any) const componentStack = errorInfo.componentStack
.componentStack
if (typeof componentStack === 'string') { if (typeof componentStack === 'string') {
trackAllowedDynamicAccess( trackAllowedDynamicAccess(
route, route,
...@@ -2292,6 +2308,8 @@ async function spawnDynamicValidationInDev( ...@@ -2292,6 +2308,8 @@ async function spawnDynamicValidationInDev(
} }
return return
} }
return getDigestForWellKnownError(err)
}, },
} }
), ),
...@@ -2444,7 +2462,10 @@ async function prerenderToStream( ...@@ -2444,7 +2462,10 @@ async function prerenderToStream(
onHTMLRenderSSRError onHTMLRenderSSRError
) )
let reactServerPrerenderResult: null | ReactServerPrerenderResult = null let reactServerPrerenderResult:
| null
| ReactServerPrerenderResult
| ServerPrerenderStreamResult = null
const setHeader = (name: string, value: string | string[]) => { const setHeader = (name: string, value: string | string[]) => {
res.setHeader(name, value) res.setHeader(name, value)
...@@ -2525,7 +2546,13 @@ async function prerenderToStream( ...@@ -2525,7 +2546,13 @@ async function prerenderToStream(
initialServerPayload, initialServerPayload,
clientReferenceManifest.clientModules, clientReferenceManifest.clientModules,
{ {
onError: (err: unknown) => { onError: (err) => {
const digest = getDigestForWellKnownError(err)
if (digest) {
return digest
}
if (initialServerPrerenderController.signal.aborted) { if (initialServerPrerenderController.signal.aborted) {
// The render aborted before this error was handled which indicates // The render aborted before this error was handled which indicates
// the error is caused by unfinished components within the render // the error is caused by unfinished components within the render
...@@ -2612,7 +2639,13 @@ async function prerenderToStream( ...@@ -2612,7 +2639,13 @@ async function prerenderToStream(
/>, />,
{ {
signal: initialClientController.signal, signal: initialClientController.signal,
onError: (err: unknown, _errorInfo: ErrorInfo) => { onError: (err) => {
const digest = getDigestForWellKnownError(err)
if (digest) {
return digest
}
if (initialClientController.signal.aborted) { if (initialClientController.signal.aborted) {
// These are expected errors that might error the prerender. we ignore them. // These are expected errors that might error the prerender. we ignore them.
} else if ( } else if (
...@@ -2999,7 +3032,13 @@ async function prerenderToStream( ...@@ -2999,7 +3032,13 @@ async function prerenderToStream(
firstAttemptRSCPayload, firstAttemptRSCPayload,
clientReferenceManifest.clientModules, clientReferenceManifest.clientModules,
{ {
onError: (err: unknown) => { onError: (err) => {
const digest = getDigestForWellKnownError(err)
if (digest) {
return digest
}
if ( if (
initialServerPrerenderController.signal.aborted || initialServerPrerenderController.signal.aborted ||
initialServerRenderController.signal.aborted initialServerRenderController.signal.aborted
...@@ -3057,7 +3096,13 @@ async function prerenderToStream( ...@@ -3057,7 +3096,13 @@ async function prerenderToStream(
/>, />,
{ {
signal: initialClientController.signal, signal: initialClientController.signal,
onError: (err: unknown, _errorInfo: ErrorInfo) => { onError: (err) => {
const digest = getDigestForWellKnownError(err)
if (digest) {
return digest
}
if (initialClientController.signal.aborted) { if (initialClientController.signal.aborted) {
// These are expected errors that might error the prerender. we ignore them. // These are expected errors that might error the prerender. we ignore them.
} else if ( } else if (
...@@ -3155,33 +3200,34 @@ async function prerenderToStream( ...@@ -3155,33 +3200,34 @@ async function prerenderToStream(
res.statusCode === 404 res.statusCode === 404
) )
const serverPrerenderStreamResult = await prerenderServerWithPhases( const serverPrerenderStreamResult = (reactServerPrerenderResult =
finalServerController.signal, await prerenderServerWithPhases(
() => finalServerController.signal,
workUnitAsyncStorage.run( () =>
finalServerPrerenderStore, workUnitAsyncStorage.run(
ComponentMod.renderToReadableStream, finalServerPrerenderStore,
finalServerPayload, ComponentMod.renderToReadableStream,
clientReferenceManifest.clientModules, finalServerPayload,
{ clientReferenceManifest.clientModules,
onError: (err: unknown) => { {
if (finalServerController.signal.aborted) { onError: (err: unknown) => {
serverIsDynamic = true if (finalServerController.signal.aborted) {
if (isPrerenderInterruptedError(err)) { serverIsDynamic = true
return err.digest if (isPrerenderInterruptedError(err)) {
return err.digest
}
return getDigestForWellKnownError(err)
} }
return
}
return serverComponentsErrorHandler(err) return serverComponentsErrorHandler(err)
}, },
signal: finalServerController.signal, signal: finalServerController.signal,
} }
), ),
() => { () => {
finalServerController.abort() finalServerController.abort()
} }
) ))
let htmlStream let htmlStream
const serverPhasedStream = serverPrerenderStreamResult.asPhasedStream() const serverPhasedStream = serverPrerenderStreamResult.asPhasedStream()
...@@ -3764,6 +3810,14 @@ async function prerenderToStream( ...@@ -3764,6 +3810,14 @@ async function prerenderToStream(
} }
const validateRootLayout = renderOpts.dev const validateRootLayout = renderOpts.dev
// This is intentionally using the readable datastream from the main
// render rather than the flight data from the error page render
const flightStream =
reactServerPrerenderResult instanceof ServerPrerenderStreamResult
? reactServerPrerenderResult.asStream()
: reactServerPrerenderResult.consumeAsStream()
return { return {
// Returning the error that was thrown so it can be used to handle // Returning the error that was thrown so it can be used to handle
// the response in the caller. // the response in the caller.
...@@ -3771,10 +3825,7 @@ async function prerenderToStream( ...@@ -3771,10 +3825,7 @@ async function prerenderToStream(
ssrErrors: allCapturedErrors, ssrErrors: allCapturedErrors,
stream: await continueFizzStream(fizzStream, { stream: await continueFizzStream(fizzStream, {
inlinedDataStream: createInlinedDataReadableStream( inlinedDataStream: createInlinedDataReadableStream(
// This is intentionally using the readable datastream from the flightStream,
// main render rather than the flight data from the error page
// render
reactServerPrerenderResult.consumeAsStream(),
ctx.nonce, ctx.nonce,
formState formState
), ),
......
...@@ -21,6 +21,27 @@ type SSRErrorHandler = ( ...@@ -21,6 +21,27 @@ type SSRErrorHandler = (
export type DigestedError = Error & { digest: string } export type DigestedError = Error & { digest: string }
/**
* Returns a digest for well-known Next.js errors, otherwise `undefined`. If a
* digest is returned this also means that the error does not need to be
* reported.
*/
export function getDigestForWellKnownError(error: unknown): string | undefined {
// If we're bailing out to CSR, we don't need to log the error.
if (isBailoutToCSRError(error)) return error.digest
// If this is a navigation error, we don't need to log the error.
if (isNextRouterError(error)) return error.digest
// If this error occurs, we know that we should be stopping the static
// render. This is only thrown in static generation when PPR is not enabled,
// which causes the whole page to be marked as dynamic. We don't need to
// tell the user about this error, as it's not actionable.
if (isDynamicServerError(error)) return error.digest
return undefined
}
export function createFlightReactServerErrorHandler( export function createFlightReactServerErrorHandler(
shouldFormatError: boolean, shouldFormatError: boolean,
onReactServerRenderError: (err: DigestedError) => void onReactServerRenderError: (err: DigestedError) => void
...@@ -34,17 +55,11 @@ export function createFlightReactServerErrorHandler( ...@@ -34,17 +55,11 @@ export function createFlightReactServerErrorHandler(
// If the response was closed, we don't need to log the error. // If the response was closed, we don't need to log the error.
if (isAbortError(thrownValue)) return if (isAbortError(thrownValue)) return
// If we're bailing out to CSR, we don't need to log the error. const digest = getDigestForWellKnownError(thrownValue)
if (isBailoutToCSRError(thrownValue)) return thrownValue.digest
// If this is a navigation error, we don't need to log the error. if (digest) {
if (isNextRouterError(thrownValue)) return thrownValue.digest return digest
}
// If this error occurs, we know that we should be stopping the static
// render. This is only thrown in static generation when PPR is not enabled,
// which causes the whole page to be marked as dynamic. We don't need to
// tell the user about this error, as it's not actionable.
if (isDynamicServerError(thrownValue)) return thrownValue.digest
const err = getProperError(thrownValue) as DigestedError const err = getProperError(thrownValue) as DigestedError
...@@ -92,17 +107,11 @@ export function createHTMLReactServerErrorHandler( ...@@ -92,17 +107,11 @@ export function createHTMLReactServerErrorHandler(
// If the response was closed, we don't need to log the error. // If the response was closed, we don't need to log the error.
if (isAbortError(thrownValue)) return if (isAbortError(thrownValue)) return
// If we're bailing out to CSR, we don't need to log the error. const digest = getDigestForWellKnownError(thrownValue)
if (isBailoutToCSRError(thrownValue)) return thrownValue.digest
// If this is a navigation error, we don't need to log the error. if (digest) {
if (isNextRouterError(thrownValue)) return thrownValue.digest return digest
}
// If this error occurs, we know that we should be stopping the static
// render. This is only thrown in static generation when PPR is not enabled,
// which causes the whole page to be marked as dynamic. We don't need to
// tell the user about this error, as it's not actionable.
if (isDynamicServerError(thrownValue)) return thrownValue.digest
const err = getProperError(thrownValue) as DigestedError const err = getProperError(thrownValue) as DigestedError
...@@ -168,17 +177,11 @@ export function createHTMLErrorHandler( ...@@ -168,17 +177,11 @@ export function createHTMLErrorHandler(
// If the response was closed, we don't need to log the error. // If the response was closed, we don't need to log the error.
if (isAbortError(thrownValue)) return if (isAbortError(thrownValue)) return
// If we're bailing out to CSR, we don't need to log the error. const digest = getDigestForWellKnownError(thrownValue)
if (isBailoutToCSRError(thrownValue)) return thrownValue.digest
// If this is a navigation error, we don't need to log the error. if (digest) {
if (isNextRouterError(thrownValue)) return thrownValue.digest return digest
}
// If this error occurs, we know that we should be stopping the static
// render. This is only thrown in static generation when PPR is not enabled,
// which causes the whole page to be marked as dynamic. We don't need to
// tell the user about this error, as it's not actionable.
if (isDynamicServerError(thrownValue)) return thrownValue.digest
const err = getProperError(thrownValue) as DigestedError const err = getProperError(thrownValue) as DigestedError
// If the error already has a digest, respect the original digest, // If the error already has a digest, respect the original digest,
......
import { getDigestForWellKnownError } from './create-error-handler'
export function printDebugThrownValueForProspectiveRender( export function printDebugThrownValueForProspectiveRender(
thrownValue: unknown, thrownValue: unknown,
route: string route: string
) { ) {
// We don't need to print well-known Next.js errors.
if (getDigestForWellKnownError(thrownValue)) {
return
}
let message: undefined | string let message: undefined | string
if ( if (
typeof thrownValue === 'object' && typeof thrownValue === 'object' &&
......
...@@ -38,7 +38,7 @@ import type { CacheHandler, CacheEntry } from '../lib/cache-handlers/types' ...@@ -38,7 +38,7 @@ import type { CacheHandler, CacheEntry } from '../lib/cache-handlers/types'
import type { CacheSignal } from '../app-render/cache-signal' import type { CacheSignal } from '../app-render/cache-signal'
import { decryptActionBoundArgs } from '../app-render/encryption' import { decryptActionBoundArgs } from '../app-render/encryption'
import { InvariantError } from '../../shared/lib/invariant-error' import { InvariantError } from '../../shared/lib/invariant-error'
import { createFlightReactServerErrorHandler } from '../app-render/create-error-handler' import { getDigestForWellKnownError } from '../app-render/create-error-handler'
const isEdgeRuntime = process.env.NEXT_RUNTIME === 'edge' const isEdgeRuntime = process.env.NEXT_RUNTIME === 'edge'
...@@ -335,13 +335,19 @@ async function generateCacheEntryImpl( ...@@ -335,13 +335,19 @@ async function generateCacheEntryImpl(
// digests are handled correctly. Error formatting and reporting is not // digests are handled correctly. Error formatting and reporting is not
// necessary here; the errors are encoded in the stream, and will be // necessary here; the errors are encoded in the stream, and will be
// reported in the "Server" environment. // reported in the "Server" environment.
onError: createFlightReactServerErrorHandler(false, (error: unknown) => { onError: (error) => {
const digest = getDigestForWellKnownError(error)
if (digest) {
return digest
}
// TODO: For now we're also reporting the error here, because in // TODO: For now we're also reporting the error here, because in
// production, the "Server" environment will only get the obfuscated // production, the "Server" environment will only get the obfuscated
// error (created by the Flight Client in the cache wrapper). // error (created by the Flight Client in the cache wrapper).
console.error(error) console.error(error)
errors.push(error) errors.push(error)
}), },
} }
) )
......
export default async function Page() {
throw new Error('Kaputt!')
return <p>This page always errors.</p>
}
...@@ -43,6 +43,21 @@ describe('Dynamic IO Dev Errors', () => { ...@@ -43,6 +43,21 @@ describe('Dynamic IO Dev Errors', () => {
) )
}) })
it('should not log unhandled rejections for persistently thrown top-level errors', async () => {
const cliOutputLength = next.cliOutput.length
const res = await next.fetch('/top-level-error')
expect(res.status).toBe(500)
await retry(() => {
const cliOutput = next.cliOutput.slice(cliOutputLength)
expect(cliOutput).toContain('GET /top-level-error 500')
})
expect(next.cliOutput.slice(cliOutputLength)).not.toContain(
'unhandledRejection'
)
})
// NOTE: when update this snapshot, use `pnpm build` in packages/next to avoid next source code get mapped to source. // NOTE: when update this snapshot, use `pnpm build` in packages/next to avoid next source code get mapped to source.
it('should display error when component accessed data without suspense boundary', async () => { it('should display error when component accessed data without suspense boundary', async () => {
const outputIndex = next.cliOutput.length const outputIndex = next.cliOutput.length
......
import { getSentinelValue } from '../../getSentinelValue'
export default function NotFound() {
return (
<>
<p>
This 404 page is made up of entirely static content in a sync function.
</p>
<p>With PPR this page should be entirely static.</p>
<p>Without PPR this page should be static.</p>
<div id="page">{getSentinelValue()}</div>
</>
)
}
import { notFound } from 'next/navigation'
export default async function Page() {
notFound()
return <p>This will never render</p>
}
...@@ -64,6 +64,18 @@ describe('dynamic-io', () => { ...@@ -64,6 +64,18 @@ describe('dynamic-io', () => {
expect(await hasStaticIndicator(browser)).toBe(true) expect(await hasStaticIndicator(browser)).toBe(true)
}) })
it('should have static indicator on not-found route', async () => {
const browser = await next.browser('/cases/not-found')
await retry(async () => {
expect(await browser.eval('!!window.next.router ? "yes": "no"')).toBe(
'yes'
)
expect(await hasStaticIndicator(browser)).toBe(true)
})
})
} }
it('should not have route specific errors', async () => { it('should not have route specific errors', async () => {
...@@ -71,7 +83,15 @@ describe('dynamic-io', () => { ...@@ -71,7 +83,15 @@ describe('dynamic-io', () => {
expect(next.cliOutput).not.toMatch('Error occurred prerendering page') expect(next.cliOutput).not.toMatch('Error occurred prerendering page')
}) })
if (!isNextDev) { if (isNextDev) {
it('should not log not-found errors', async () => {
const cliOutputLength = next.cliOutput.length
await next.browser('/cases/not-found')
const cliOutput = next.cliOutput.slice(cliOutputLength)
expect(cliOutput).not.toMatch('Error: NEXT_HTTP_ERROR_FALLBACK;404')
expect(cliOutput).not.toMatch('unhandledRejection')
})
} else {
it('should not warn about potential memory leak for even listeners on AbortSignal', async () => { it('should not warn about potential memory leak for even listeners on AbortSignal', async () => {
expect(next.cliOutput).not.toMatch('MaxListenersExceededWarning') expect(next.cliOutput).not.toMatch('MaxListenersExceededWarning')
}) })
...@@ -82,9 +102,6 @@ describe('dynamic-io', () => { ...@@ -82,9 +102,6 @@ describe('dynamic-io', () => {
if (isNextDev) { if (isNextDev) {
expect($('#layout').text()).toBe('at runtime') expect($('#layout').text()).toBe('at runtime')
expect($('#page').text()).toBe('at runtime') expect($('#page').text()).toBe('at runtime')
} else if (WITH_PPR) {
expect($('#layout').text()).toBe('at buildtime')
expect($('#page').text()).toBe('at buildtime')
} else { } else {
expect($('#layout').text()).toBe('at buildtime') expect($('#layout').text()).toBe('at buildtime')
expect($('#page').text()).toBe('at buildtime') expect($('#page').text()).toBe('at buildtime')
...@@ -94,23 +111,31 @@ describe('dynamic-io', () => { ...@@ -94,23 +111,31 @@ describe('dynamic-io', () => {
if (isNextDev) { if (isNextDev) {
expect($('#layout').text()).toBe('at runtime') expect($('#layout').text()).toBe('at runtime')
expect($('#page').text()).toBe('at runtime') expect($('#page').text()).toBe('at runtime')
} else if (WITH_PPR) {
expect($('#layout').text()).toBe('at buildtime')
expect($('#page').text()).toBe('at buildtime')
} else { } else {
expect($('#layout').text()).toBe('at buildtime') expect($('#layout').text()).toBe('at buildtime')
expect($('#page').text()).toBe('at buildtime') expect($('#page').text()).toBe('at buildtime')
} }
}) })
it('should prerender static not-found pages', async () => {
// Using `browser` instead of `render$` because error pages must be hydrated
// apparently.
const browser = await next.browser('/cases/not-found')
if (isNextDev) {
expect(await browser.elementById('layout').text()).toBe('at runtime')
expect(await browser.elementById('page').text()).toBe('at runtime')
} else {
expect(await browser.elementById('layout').text()).toBe('at buildtime')
expect(await browser.elementById('page').text()).toBe('at buildtime')
}
})
it('should prerender pages that render in a microtask', async () => { it('should prerender pages that render in a microtask', async () => {
let $ = await next.render$('/cases/microtask', {}) let $ = await next.render$('/cases/microtask', {})
if (isNextDev) { if (isNextDev) {
expect($('#layout').text()).toBe('at runtime') expect($('#layout').text()).toBe('at runtime')
expect($('#page').text()).toBe('at runtime') expect($('#page').text()).toBe('at runtime')
} else if (WITH_PPR) {
expect($('#layout').text()).toBe('at buildtime')
expect($('#page').text()).toBe('at buildtime')
} else { } else {
expect($('#layout').text()).toBe('at buildtime') expect($('#layout').text()).toBe('at buildtime')
expect($('#page').text()).toBe('at buildtime') expect($('#page').text()).toBe('at buildtime')
...@@ -120,9 +145,6 @@ describe('dynamic-io', () => { ...@@ -120,9 +145,6 @@ describe('dynamic-io', () => {
if (isNextDev) { if (isNextDev) {
expect($('#layout').text()).toBe('at runtime') expect($('#layout').text()).toBe('at runtime')
expect($('#page').text()).toBe('at runtime') expect($('#page').text()).toBe('at runtime')
} else if (WITH_PPR) {
expect($('#layout').text()).toBe('at buildtime')
expect($('#page').text()).toBe('at buildtime')
} else { } else {
expect($('#layout').text()).toBe('at buildtime') expect($('#layout').text()).toBe('at buildtime')
expect($('#page').text()).toBe('at buildtime') expect($('#page').text()).toBe('at buildtime')
......
// TODO: This should not need the suspense boundary in the root layout.
'use cache' 'use cache'
import { notFound } from 'next/navigation' import { notFound } from 'next/navigation'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment