@@ -759,7 +759,11 @@ export function trackAllowedDynamicAccess(
)
return
}else{
constmessage=`Route "${workStore.route}": A component accessed data, headers, params, searchParams, or a short-lived cache without a Suspense boundary nor a "use cache" above it. See more info: https://nextjs.org/docs/messages/next-prerender-missing-suspense`
constmessage=
`Route "${workStore.route}": Uncached data was accessed outside of `+
'<Suspense>. This delays the entire page from rendering, resulting in a '+
'Route "/uncached": A component accessed data, headers, params, searchParams, or a short-lived cache without a Suspense boundary nor a "use cache" above it'
'Route "/uncached": A component accessed data, headers, params, searchParams, or a short-lived cache without a Suspense boundary nor a "use cache" above it'
`A component accessed data, headers, params, searchParams, or a short-lived cache without a Suspense boundary nor a "use cache" above it. `+
`See more info: https://nextjs.org/docs/messages/next-prerender-missing-suspense`+
'\n at Page (app/no-accessed-data/page.js:1:31)'+
'\n> 1 | export default async function Page() {'+
'\n | ^'+
'\n 2 | await new Promise((r) => setTimeout(r, 200))'+
'\n 3 | return <p>Page</p>'+
'\n 4 | }'
'https://nextjs.org/docs/messages/blocking-route'
)
awaitexpect(browser).toDisplayCollapsedRedbox(`
{
"description": "Route "/no-accessed-data": A component accessed data, headers, params, searchParams, or a short-lived cache without a Suspense boundary nor a "use cache" above it. See more info: https://nextjs.org/docs/messages/next-prerender-missing-suspense",
"description": "Uncached data was accessed outside of <Suspense>
This delays the entire page from rendering, resulting in a slow user experience. Next.js uses this error to ensure your app loads instantly on every navigation.
To fix this, you can:
Wrap the component in a <Suspense> boundary. This allows Next.js to stream its contents to the user as soon as it's ready, without blocking the rest of the app.
Move the asynchronous await into a Cache Component ("use cache"). This allows Next.js to statically prerender the component as part of the HTML document, so it's instantly visible to the user. Note that request-specific information — such as params, cookies, and headers — is not available during static prerendering.
// This is currently expected to fail because we can only track `import()` in bundled code,
// and packages marked as external aren't bundled.
it('does not instrument import() in external packages',async()=>{
constexpectedError=`Error: Route "/": A component accessed data, headers, params, searchParams, or a short-lived cache without a Suspense boundary nor a "use cache" above it.`
?`Route "/": A component accessed data, headers, params, searchParams, or a short-lived cache without a Suspense boundary nor a "use cache" above it. See more info: https://nextjs.org/docs/messages/next-prerender-missing-suspense`