diff --git a/packages/next/errors.json b/packages/next/errors.json index e771e451a2ad..cfc81bdc0063 100644 --- a/packages/next/errors.json +++ b/packages/next/errors.json @@ -1250,10 +1250,31 @@ "1249": "Route \"%s\": Next.js encountered uncached data during the initial render or a navigation.\\n\\n\\`fetch(...)\\` or \\`connection()\\` accessed outside of \\`\\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience.\\n\\nWays to fix this:\\n - Cache the data access with \\`\"use cache\"\\`\\n - Provide a placeholder with \\`\\` around the data access\\n - Set \\`export const instant = false\\` to allow a blocking route\\n\\nLearn more: https://nextjs.org/docs/messages/blocking-route", "1250": "Route \"%s\": Next.js encountered runtime data during the initial render or a navigation.\\n\\n\\`cookies()\\`, \\`headers()\\`, \\`params\\`, or \\`searchParams\\` accessed outside of \\`\\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience.\\n\\nWays to fix this:\\n - Use \\`generateStaticParams\\` to make route params static\\n - Provide a placeholder with \\`\\` around the data access\\n - Set \\`export const instant = false\\` to allow a blocking route\\n\\nLearn more: https://nextjs.org/docs/messages/blocking-route", "1251": "Route \"%s\": Next.js encountered runtime data during the initial render or a navigation.\\n\\n\\`cookies()\\`, \\`headers()\\`, \\`params\\`, or \\`searchParams\\` accessed outside of \\`\\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience.\\n\\nWays to fix this:\\n - Provide a placeholder with \\`\\` around the data access\\n - Use \\`generateStaticParams\\` to make route params static\\n - Set \\`export const instant = false\\` to allow a blocking route\\n\\nLearn more: https://nextjs.org/docs/messages/blocking-route", - "1252": "\\`experimental.cssChunking: \"graph\"\\` is only supported with Turbopack. Please remove the option or run Next.js with Turbopack in %s.", - "1253": "\\`experimental.cssChunking: \"strict\"\\` is only supported with webpack. Please remove the option or run Next.js with webpack in %s.", - "1254": "\\`experimental.cssChunking: false\\` is only supported with webpack. Please remove the option or run Next.js with webpack in %s.", - "1255": "Compilation failed but no issues were recorded", - "1256": "no route matched for path \"%s\"", - "1257": "compileRoute: either routeSpecifier or path is required" + "1252": "Route \"%s\": Next.js encountered runtime data in \\`generateViewport()\\`.\\n\\n\\`cookies()\\`, \\`headers()\\`, \\`params\\`, or \\`searchParams\\` in \\`generateViewport()\\` prevents the page from being prerendered, leading to a slower user experience.\\n\\nWays to fix this:\\n - Use a static viewport export instead of \\`generateViewport()\\`\\n - Set \\`export const instant = false\\` to allow a blocking route\\n\\nLearn more: https://nextjs.org/docs/messages/next-prerender-dynamic-viewport", + "1253": "Route \"%s\": Next.js encountered uncached or runtime data in \\`generateViewport()\\`.\\n\\nThis prevents the page from being prerendered, leading to a slower user experience.\\n\\nWays to fix this:\\n - Use a static viewport export instead of \\`generateViewport()\\`\\n - Cache the viewport data with \\`\"use cache\"\\` in \\`generateViewport()\\`\\n - Set \\`export const instant = false\\` to allow a blocking route\\n\\nLearn more: https://nextjs.org/docs/messages/next-prerender-dynamic-viewport", + "1254": "Route \"%s\": Next.js encountered uncached or runtime data during the initial render.\\n\\n\\`fetch(...)\\`, \\`cookies()\\`, \\`headers()\\`, \\`params\\`, \\`searchParams\\`, or \\`connection()\\` accessed outside of \\`\\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience.\\n\\nWays to fix this:\\n - Cache the data access with \\`\"use cache\"\\`\\n - Provide a placeholder with \\`\\` around the data access\\n - If params are known, prerender them with \\`generateStaticParams\\`\\n - Set \\`export const instant = false\\` to allow a blocking route\\n\\nLearn more: https://nextjs.org/docs/messages/blocking-route", + "1255": "Route \"%s\": Next.js encountered uncached data in \\`generateViewport()\\`.\\n\\n\\`fetch(...)\\` or \\`connection()\\` in \\`generateViewport()\\` prevents the page from being prerendered, leading to a slower user experience.\\n\\nWays to fix this:\\n - Cache the viewport data with \\`\"use cache\"\\` in \\`generateViewport()\\`\\n - Set \\`export const instant = false\\` to allow a blocking route\\n\\nLearn more: https://nextjs.org/docs/messages/next-prerender-dynamic-viewport", + "1256": "Route \"%s\": Next.js encountered %s in a Client Component.\\n\\nThis value would be evaluated during the prerender, instead of recomputed on each visit.\\n\\nWays to fix this:\\n - Wrap the Client Component in \\`\\`\\n - Move the read into a \\`useEffect\\` or event handler\\n%s\\nLearn more: %s", + "1257": "Route \"%s\": Next.js encountered runtime data during the initial render.\\n\\n\\`cookies()\\`, \\`headers()\\`, \\`params\\`, or \\`searchParams\\` accessed outside of \\`\\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience.\\n\\nWays to fix this:\\n - Provide a placeholder with \\`\\` around the data access\\n - If params are known, prerender them with \\`generateStaticParams\\`\\n - Set \\`export const instant = false\\` to allow a blocking route\\n\\nLearn more: https://nextjs.org/docs/messages/blocking-route", + "1258": "Route \"%s\": Next.js encountered runtime data during the initial render or a navigation.\\n\\n\\`cookies()\\`, \\`headers()\\`, \\`params\\`, or \\`searchParams\\` accessed outside of \\`\\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience.\\n\\nWays to fix this:\\n - Provide a placeholder with \\`\\` around the data access\\n - If params are known, prerender them with \\`generateStaticParams\\`\\n - Set \\`export const instant = false\\` to allow a blocking route\\n\\nLearn more: https://nextjs.org/docs/messages/blocking-route", + "1259": "Route \"%s\": Next.js encountered %s while prerendering.\\n\\nThis value can change between renders, so it must be either prerendered or computed later.\\n\\nWays to fix this:\\n - Render at request time by adding a dynamic data access (e.g. \\`await connection()\\`) before this call\\n - Prerender and cache the value with \\`\"use cache\"\\`\\n - Render the value on the client with \\`\"use client\"\\`\\n%s\\nLearn more: %s", + "1260": "Route \"%s\": Next.js encountered runtime data during prerendering or a navigation.\\n\\n\\`cookies()\\`, \\`headers()\\`, \\`params\\`, or \\`searchParams\\` accessed outside of \\`\\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience.\\n\\nWays to fix this:\\n - Provide a placeholder with \\`\\` around the data access\\n - If params are known, prerender them with \\`generateStaticParams\\`\\n - Set \\`export const instant = false\\` to allow a blocking route\\n\\nLearn more: https://nextjs.org/docs/messages/blocking-route", + "1261": "Route \"%s\": Next.js encountered the unstable value %s while prerendering.\\n\\nThis value can change between renders, so it must be either prerendered or computed later.\\n\\nWays to fix this:\\n - Render at request time by adding a dynamic data access (e.g. \\`await connection()\\`) before this call\\n - Prerender and cache the value with \\`\"use cache\"\\`\\n - Render the value on the client with \\`\"use client\"\\`\\n%s\\nLearn more: %s", + "1262": "Route \"%s\": Next.js encountered uncached or runtime data during prerendering.\\n\\n\\`fetch(...)\\`, \\`cookies()\\`, \\`headers()\\`, \\`params\\`, \\`searchParams\\`, or \\`connection()\\` accessed outside of \\`\\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience.\\n\\nWays to fix this:\\n - Cache the data access with \\`\"use cache\"\\`\\n - Provide a placeholder with \\`\\` around the data access\\n - If params are known, prerender them with \\`generateStaticParams\\`\\n - Set \\`export const instant = false\\` to allow a blocking route\\n\\nLearn more: https://nextjs.org/docs/messages/blocking-route", + "1263": "Route \"%s\": Next.js encountered runtime data during prerendering.\\n\\n\\`cookies()\\`, \\`headers()\\`, \\`params\\`, or \\`searchParams\\` accessed outside of \\`\\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience.\\n\\nWays to fix this:\\n - Provide a placeholder with \\`\\` around the data access\\n - If params are known, prerender them with \\`generateStaticParams\\`\\n - Set \\`export const instant = false\\` to allow a blocking route\\n\\nLearn more: https://nextjs.org/docs/messages/blocking-route", + "1264": "Route \"%s\": Next.js encountered uncached data during prerendering or a navigation.\\n\\n\\`fetch(...)\\` or \\`connection()\\` accessed outside of \\`\\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience.\\n\\nWays to fix this:\\n - Cache the data access with \\`\"use cache\"\\`\\n - Provide a placeholder with \\`\\` around the data access\\n - Set \\`export const instant = false\\` to allow a blocking route\\n\\nLearn more: https://nextjs.org/docs/messages/blocking-route", + "1265": "Route \"%s\": Next.js encountered uncached data during prerendering.\\n\\n\\`fetch(...)\\` or \\`connection()\\` accessed outside of \\`\\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience.\\n\\nWays to fix this:\\n - Cache the data access with \\`\"use cache\"\\`\\n - Provide a placeholder with \\`\\` around the data access\\n - Set \\`export const instant = false\\` to allow a blocking route\\n\\nLearn more: https://nextjs.org/docs/messages/blocking-route", + "1266": "Route \"%s\": Next.js encountered the unstable value %s in a Client Component.\\n\\nThis value would be evaluated during the prerender, instead of recomputed on each visit.\\n\\nWays to fix this:\\n - Wrap the Client Component in \\`\\`\\n - Move the read into a \\`useEffect\\` or event handler\\n%s\\nLearn more: %s", + "1267": "Route \"%s\": Next.js encountered runtime data during prerendering.\\n\\n\\`cookies()\\`, \\`headers()\\`, \\`params\\`, or \\`searchParams\\` accessed outside of \\`\\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience.\\n\\nWays to fix this:\\n - Provide a placeholder with \\`\\` around the data access\\n - Prerender params if known with \\`generateStaticParams\\`\\n - Set \\`export const instant = false\\` to allow a blocking route\\n\\nLearn more: https://nextjs.org/docs/messages/blocking-route", + "1268": "Route \"%s\": Next.js encountered runtime data during prerendering or a navigation.\\n\\n\\`cookies()\\`, \\`headers()\\`, \\`params\\`, or \\`searchParams\\` accessed outside of \\`\\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience.\\n\\nWays to fix this:\\n - Provide a placeholder with \\`\\` around the data access\\n - Prerender params if known with \\`generateStaticParams\\`\\n - Set \\`export const instant = false\\` to allow a blocking route\\n\\nLearn more: https://nextjs.org/docs/messages/blocking-route", + "1269": "Route \"%s\": Next.js encountered uncached or runtime data during prerendering.\\n\\n\\`fetch(...)\\`, \\`cookies()\\`, \\`headers()\\`, \\`params\\`, \\`searchParams\\`, or \\`connection()\\` accessed outside of \\`\\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience.\\n\\nWays to fix this:\\n - Cache the data access with \\`\"use cache\"\\`\\n - Provide a placeholder with \\`\\` around the data access\\n - Prerender params if known with \\`generateStaticParams\\`\\n - Set \\`export const instant = false\\` to allow a blocking route\\n\\nLearn more: https://nextjs.org/docs/messages/blocking-route", + "1270": "Route \"%s\": Next.js encountered uncached or runtime data during prerendering.\\n\\n\\`fetch(...)\\`, \\`cookies()\\`, \\`headers()\\`, \\`params\\`, \\`searchParams\\`, or \\`connection()\\` accessed outside of \\`\\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience.\\n\\nWays to fix this:\\n - Cache the data access with \\`\"use cache\"\\`\\n - Provide a placeholder with \\`\\` around the data access\\n - If the runtime data is \\`params\\` and they're known, prerender them with \\`generateStaticParams\\`\\n - Set \\`export const instant = false\\` to allow a blocking route\\n\\nLearn more: https://nextjs.org/docs/messages/blocking-route", + "1271": "Route \"%s\": Next.js encountered runtime data during prerendering or a navigation.\\n\\n\\`cookies()\\`, \\`headers()\\`, \\`params\\`, or \\`searchParams\\` accessed outside of \\`\\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience.\\n\\nWays to fix this:\\n - Provide a placeholder with \\`\\` around the data access\\n - If the runtime data is \\`params\\` and they're known, prerender them with \\`generateStaticParams\\`\\n - Set \\`export const instant = false\\` to allow a blocking route\\n\\nLearn more: https://nextjs.org/docs/messages/blocking-route", + "1272": "Route \"%s\": Next.js encountered runtime data during prerendering.\\n\\n\\`cookies()\\`, \\`headers()\\`, \\`params\\`, or \\`searchParams\\` accessed outside of \\`\\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience.\\n\\nWays to fix this:\\n - Provide a placeholder with \\`\\` around the data access\\n - If the runtime data is \\`params\\` and they're known, prerender them with \\`generateStaticParams\\`\\n - Set \\`export const instant = false\\` to allow a blocking route\\n\\nLearn more: https://nextjs.org/docs/messages/blocking-route", + "1273": "\\`experimental.cssChunking: \"graph\"\\` is only supported with Turbopack. Please remove the option or run Next.js with Turbopack in %s.", + "1274": "\\`experimental.cssChunking: \"strict\"\\` is only supported with webpack. Please remove the option or run Next.js with webpack in %s.", + "1275": "\\`experimental.cssChunking: false\\` is only supported with webpack. Please remove the option or run Next.js with webpack in %s.", + "1276": "Compilation failed but no issues were recorded", + "1277": "no route matched for path \"%s\"", + "1278": "compileRoute: either routeSpecifier or path is required" } diff --git a/packages/next/src/next-devtools/dev-overlay/components/errors/dialog/dialog.tsx b/packages/next/src/next-devtools/dev-overlay/components/errors/dialog/dialog.tsx index 4691f16df33a..cfc7dc6315e9 100644 --- a/packages/next/src/next-devtools/dev-overlay/components/errors/dialog/dialog.tsx +++ b/packages/next/src/next-devtools/dev-overlay/components/errors/dialog/dialog.tsx @@ -39,6 +39,7 @@ export const DIALOG_STYLES = ` .error-overlay-dialog-scroll { overflow-y: auto; + scrollbar-gutter: stable; height: 100%; } ` diff --git a/packages/next/src/next-devtools/dev-overlay/components/instant/instant-guidance-data.ts b/packages/next/src/next-devtools/dev-overlay/components/instant/instant-guidance-data.ts index 1d6207dcb489..d513b1c11c02 100644 --- a/packages/next/src/next-devtools/dev-overlay/components/instant/instant-guidance-data.ts +++ b/packages/next/src/next-devtools/dev-overlay/components/instant/instant-guidance-data.ts @@ -16,7 +16,7 @@ export type FixCardIcon = | 'database' | 'history' | 'layout' - | 'octagon' + | 'loading' | 'pointer-click' | 'server-stack' | 'timer' @@ -28,7 +28,7 @@ export const FIX_CARD_GROUPS: Record< > = { stream: { label: 'Stream', color: 'blue', icon: 'align-left' }, prerender: { label: 'Prerender', color: 'purple', icon: 'history' }, - block: { label: 'Block', color: 'red', icon: 'octagon' }, + block: { label: 'Block', color: 'red', icon: 'loading' }, cache: { label: 'Cache', color: 'purple', icon: 'database' }, static: { label: 'Static', color: 'gray', icon: 'zap' }, dynamic: { label: 'Dynamic', color: 'blue', icon: 'server-stack' }, @@ -77,7 +77,7 @@ const runtimeCards: FixCard[] = [ }, { id: 'prerender-known-params', - title: 'Prerender known params', + title: 'For known params, prerender', group: 'cache', link: 'https://nextjs.org/docs/messages/blocking-route#prerender-known-params', snippets: [ @@ -162,7 +162,7 @@ const metadataRuntimeCards: FixCard[] = [ }, { id: 'render-page-at-request-time', - title: 'Generate the page on every request', + title: 'Mark the route as dynamic', group: 'dynamic', link: 'https://nextjs.org/docs/messages/next-prerender-dynamic-metadata#render-page-at-request-time', snippets: [ @@ -186,7 +186,7 @@ const metadataDynamicCards: FixCard[] = [ }, { id: 'render-page-at-request-time', - title: 'Generate the page on every request', + title: 'Mark the route as dynamic', group: 'dynamic', link: 'https://nextjs.org/docs/messages/next-prerender-dynamic-metadata#render-page-at-request-time', snippets: [ @@ -210,17 +210,6 @@ const viewportRuntimeCards: FixCard[] = [ { text: '}' }, ], }, - { - id: 'wrap-body-in-suspense', - title: 'Wrap body in Suspense', - group: 'stream', - link: 'https://nextjs.org/docs/messages/next-prerender-dynamic-viewport#wrap-body-in-suspense', - snippets: [ - { text: '', highlight: true }, - { text: ' {children}' }, - { text: '', highlight: true }, - ], - }, { id: 'allow-blocking-route', title: 'Allow blocking route', @@ -245,17 +234,6 @@ const viewportDynamicCards: FixCard[] = [ { text: ' return await db.getViewport(…)' }, ], }, - { - id: 'wrap-body-in-suspense', - title: 'Wrap body in Suspense', - group: 'stream', - link: 'https://nextjs.org/docs/messages/next-prerender-dynamic-viewport#wrap-body-in-suspense', - snippets: [ - { text: '', highlight: true }, - { text: ' {children}' }, - { text: '', highlight: true }, - ], - }, { id: 'allow-blocking-route', title: 'Allow blocking route', @@ -300,8 +278,8 @@ const syncMathCards: FixCard[] = [ link: 'https://nextjs.org/docs/messages/next-prerender-random#render-on-the-client', snippets: [ { text: '"use client"', highlight: true }, - { text: 'const [id] = useState(() => Math.random())' }, - { text: 'return ' }, + { text: '// runs in the browser' }, + { text: 'const id = Math.random()' }, ], }, ] @@ -336,13 +314,13 @@ const syncDateCards: FixCard[] = [ link: 'https://nextjs.org/docs/messages/next-prerender-current-time#render-on-the-client', snippets: [ { text: '"use client"', highlight: true }, - { text: 'useEffect(() => setT(Date.now()), [])' }, - { text: 'return ' }, + { text: '// runs in the browser' }, + { text: 'const t = Date.now()' }, ], }, { id: 'measure-elapsed-time', - title: 'Measure elapsed time', + title: 'For telemetry, use a timing API', group: 'measure', link: 'https://nextjs.org/docs/messages/next-prerender-current-time#measure-elapsed-time', snippets: [ @@ -383,8 +361,8 @@ const syncCryptoCards: FixCard[] = [ link: 'https://nextjs.org/docs/messages/next-prerender-crypto#render-on-the-client', snippets: [ { text: '"use client"', highlight: true }, - { text: 'const [id] = useState(() => crypto.randomUUID())' }, - { text: 'return ' }, + { text: '// runs in the browser' }, + { text: 'const id = crypto.randomUUID()' }, ], }, ] @@ -416,7 +394,7 @@ const syncClientDateCards: FixCard[] = [ }, { id: 'measure-elapsed-time', - title: 'Measure elapsed time', + title: 'For telemetry, use a timing API', group: 'measure', link: 'https://nextjs.org/docs/messages/next-prerender-current-time-client#measure-elapsed-time', snippets: [ diff --git a/packages/next/src/next-devtools/dev-overlay/components/instant/instant-guidance.tsx b/packages/next/src/next-devtools/dev-overlay/components/instant/instant-guidance.tsx index 6d8329438dee..5d7cb0538533 100644 --- a/packages/next/src/next-devtools/dev-overlay/components/instant/instant-guidance.tsx +++ b/packages/next/src/next-devtools/dev-overlay/components/instant/instant-guidance.tsx @@ -3,7 +3,7 @@ import { FixCardDatabaseIcon, FixCardHistoryIcon, FixCardLayoutIcon, - FixCardOctagonIcon, + FixCardLoadingIcon, FixCardPointerClickIcon, FixCardServerStackIcon, FixCardTimerIcon, @@ -41,8 +41,8 @@ function getCardIcon(icon: FixCardIcon) { return case 'timer': return - case 'octagon': - return + case 'loading': + return case 'zap': return case 'layout': @@ -237,7 +237,6 @@ export const INSTANT_GUIDANCE_STYLES = css` display: flex; flex-direction: column; min-width: 0; - overflow: hidden; position: relative; text-decoration: none; } @@ -254,6 +253,15 @@ export const INSTANT_GUIDANCE_STYLES = css` background: var(--color-background-200); } + [data-nextjs-fix-card]:hover [data-nextjs-fix-card-link-icon] { + color: var(--color-gray-1000); + } + + [data-nextjs-fix-card]:hover [data-nextjs-fix-snippet] { + border-color: var(--color-gray-500); + background: var(--color-gray-100); + } + a[data-nextjs-fix-card]:focus-visible { outline: var(--focus-ring); outline-offset: 2px; @@ -333,6 +341,7 @@ export const INSTANT_GUIDANCE_STYLES = css` line-height: 1.5; margin: 0; margin-left: -1px; + margin-bottom: -1px; padding: 14px 16px; width: calc(100% + 2px); white-space: pre; @@ -346,11 +355,6 @@ export const INSTANT_GUIDANCE_STYLES = css` text-align: left; } - [data-nextjs-fix-card]:hover [data-nextjs-fix-snippet] { - border-color: var(--color-gray-500); - background: var(--color-gray-100); - } - [data-snippet-line] { display: block; color: var(--color-gray-800); diff --git a/packages/next/src/next-devtools/dev-overlay/container/errors.tsx b/packages/next/src/next-devtools/dev-overlay/container/errors.tsx index a0d19b6aeff2..0cb632cef28d 100644 --- a/packages/next/src/next-devtools/dev-overlay/container/errors.tsx +++ b/packages/next/src/next-devtools/dev-overlay/container/errors.tsx @@ -325,7 +325,7 @@ export function isSyncIOClientError(message: string): boolean { // Detects errors emitted during navigation-phase instant validation: body // errors from `createRuntimeBodyErrorInNavigation` / // `createDynamicBodyErrorInNavigation` (SSR factories instead say "during -// the initial render"), and validation errors from +// prerendering"), and validation errors from // `trackDynamicHoleInNavigation` / `getNavigationDisallowedDynamicReasons`. export function isBlockingRouteInNavError(message: string): boolean { return ( @@ -559,10 +559,10 @@ Next.js version: ${props.versionInfo.installed} (${process.env.__NEXT_BUNDLER})\ errorDetails.variant === 'runtime' ? errorDetails.inNavigation ? 'Next.js encountered runtime data during a navigation.' - : 'Next.js encountered runtime data during the initial render.' + : 'Next.js encountered runtime data during prerendering.' : errorDetails.inNavigation ? 'Next.js encountered uncached data during a navigation.' - : 'Next.js encountered uncached data during the initial render.' + : 'Next.js encountered uncached data during prerendering.' } headerChildren={ - Next.js encountered {errorDetails.cause} without an - explicit rendering intent. + Next.js encountered the unstable value{' '} + {errorDetails.cause} while prerendering. } headerChildren={ @@ -724,13 +724,13 @@ Next.js version: ${props.versionInfo.installed} (${process.env.__NEXT_BUNDLER})\ errorType={errorType} errorMessage={ <> - Next.js encountered {errorDetails.cause} in a Client - Component. + Next.js encountered the unstable value{' '} + {errorDetails.cause} in a Client Component. } headerChildren={ } diff --git a/packages/next/src/next-devtools/dev-overlay/icons/fix-card-icons.tsx b/packages/next/src/next-devtools/dev-overlay/icons/fix-card-icons.tsx index 4e06caf331e7..e6e204b3cbfa 100644 --- a/packages/next/src/next-devtools/dev-overlay/icons/fix-card-icons.tsx +++ b/packages/next/src/next-devtools/dev-overlay/icons/fix-card-icons.tsx @@ -46,7 +46,7 @@ export function FixCardHistoryIcon() { ) } -export function FixCardOctagonIcon() { +export function FixCardLoadingIcon() { return ( - + {Array.from({ length: 12 }, (_, index) => { + const angle = index * 30 + const opacity = 1 - index * 0.05 + + return ( + + ) + })} ) } diff --git a/packages/next/src/server/app-render/blocking-route-messages.ts b/packages/next/src/server/app-render/blocking-route-messages.ts index 84801cc7a1d0..7fb52f50ac55 100644 --- a/packages/next/src/server/app-render/blocking-route-messages.ts +++ b/packages/next/src/server/app-render/blocking-route-messages.ts @@ -1,10 +1,10 @@ export function createRuntimeBodyError(route: string): Error { return new Error( - `Route "${route}": Next.js encountered runtime data during the initial render.\n\n` + - `\`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience.\n\n` + + `Route "${route}": Next.js encountered runtime data during prerendering.\n\n` + + `\`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience.\n\n` + `Ways to fix this:\n` + ` - Provide a placeholder with \`\` around the data access\n` + - ` - Use \`generateStaticParams\` to make route params static\n` + + ` - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\`\n` + ` - Set \`export const instant = false\` to allow a blocking route\n\n` + `Learn more: https://nextjs.org/docs/messages/blocking-route` ) @@ -12,8 +12,8 @@ export function createRuntimeBodyError(route: string): Error { export function createDynamicBodyError(route: string): Error { return new Error( - `Route "${route}": Next.js encountered uncached data during the initial render.\n\n` + - `\`fetch(...)\` or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience.\n\n` + + `Route "${route}": Next.js encountered uncached data during prerendering.\n\n` + + `\`fetch(...)\` or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience.\n\n` + `Ways to fix this:\n` + ` - Cache the data access with \`"use cache"\`\n` + ` - Provide a placeholder with \`\` around the data access\n` + @@ -24,11 +24,11 @@ export function createDynamicBodyError(route: string): Error { export function createRuntimeBodyErrorInNavigation(route: string): Error { return new Error( - `Route "${route}": Next.js encountered runtime data during the initial render or a navigation.\n\n` + + `Route "${route}": Next.js encountered runtime data during prerendering or a navigation.\n\n` + `\`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience.\n\n` + `Ways to fix this:\n` + ` - Provide a placeholder with \`\` around the data access\n` + - ` - Use \`generateStaticParams\` to make route params static\n` + + ` - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\`\n` + ` - Set \`export const instant = false\` to allow a blocking route\n\n` + `Learn more: https://nextjs.org/docs/messages/blocking-route` ) @@ -36,7 +36,7 @@ export function createRuntimeBodyErrorInNavigation(route: string): Error { export function createDynamicBodyErrorInNavigation(route: string): Error { return new Error( - `Route "${route}": Next.js encountered uncached data during the initial render or a navigation.\n\n` + + `Route "${route}": Next.js encountered uncached data during prerendering or a navigation.\n\n` + `\`fetch(...)\` or \`connection()\` accessed outside of \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience.\n\n` + `Ways to fix this:\n` + ` - Cache the data access with \`"use cache"\`\n` + @@ -53,12 +53,12 @@ export function createDynamicBodyErrorInNavigation(route: string): Error { */ export function createDynamicOrRuntimeBodyError(route: string): Error { return new Error( - `Route "${route}": Next.js encountered uncached or runtime data during the initial render.\n\n` + - `\`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience.\n\n` + + `Route "${route}": Next.js encountered uncached or runtime data during prerendering.\n\n` + + `\`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience.\n\n` + `Ways to fix this:\n` + ` - Cache the data access with \`"use cache"\`\n` + ` - Provide a placeholder with \`\` around the data access\n` + - ` - Use \`generateStaticParams\` to make route params static\n` + + ` - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\`\n` + ` - Set \`export const instant = false\` to allow a blocking route\n\n` + `Learn more: https://nextjs.org/docs/messages/blocking-route` ) @@ -92,7 +92,6 @@ export function createRuntimeViewportError(route: string): Error { `\`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` in \`generateViewport()\` prevents the page from being prerendered, leading to a slower user experience.\n\n` + `Ways to fix this:\n` + ` - Use a static viewport export instead of \`generateViewport()\`\n` + - ` - Wrap your document \`\` in \`\`\n` + ` - Set \`export const instant = false\` to allow a blocking route\n\n` + `Learn more: https://nextjs.org/docs/messages/next-prerender-dynamic-viewport` ) @@ -104,7 +103,6 @@ export function createDynamicViewportError(route: string): Error { `\`fetch(...)\` or \`connection()\` in \`generateViewport()\` prevents the page from being prerendered, leading to a slower user experience.\n\n` + `Ways to fix this:\n` + ` - Cache the viewport data with \`"use cache"\` in \`generateViewport()\`\n` + - ` - Wrap your document \`\` in \`\`\n` + ` - Set \`export const instant = false\` to allow a blocking route\n\n` + `Learn more: https://nextjs.org/docs/messages/next-prerender-dynamic-viewport` ) @@ -122,7 +120,6 @@ export function createDynamicOrRuntimeViewportError(route: string): Error { `Ways to fix this:\n` + ` - Use a static viewport export instead of \`generateViewport()\`\n` + ` - Cache the viewport data with \`"use cache"\` in \`generateViewport()\`\n` + - ` - Wrap your document \`\` in \`\`\n` + ` - Set \`export const instant = false\` to allow a blocking route\n\n` + `Learn more: https://nextjs.org/docs/messages/next-prerender-dynamic-viewport` ) diff --git a/packages/next/src/server/app-render/sync-io-messages.ts b/packages/next/src/server/app-render/sync-io-messages.ts index 167465073a21..dedbd050d917 100644 --- a/packages/next/src/server/app-render/sync-io-messages.ts +++ b/packages/next/src/server/app-render/sync-io-messages.ts @@ -20,7 +20,7 @@ const SYNC_IO_RUNTIME_DOCS: Record = { function elapsedTimeBullet(type: SyncIOApiType): string { return type === 'time' - ? ` - Measure elapsed time with \`performance.now()\` instead of \`Date.now()\`\n` + ? ` - If the value is for telemetry, use a timing API such as \`performance.now()\`\n` : '' } @@ -31,7 +31,7 @@ function createSyncIOErrorImpl( docsUrl: string ): Error { return new Error( - `Route "${route}": Next.js encountered ${expression} without an explicit rendering intent.\n\n` + + `Route "${route}": Next.js encountered the unstable value ${expression} while prerendering.\n\n` + `This value can change between renders, so it must be either prerendered or computed later.\n\n` + `Ways to fix this:\n` + ` - Render at request time by adding a dynamic data access (e.g. \`await connection()\`) before this call\n` + @@ -70,11 +70,12 @@ export function createSyncIOClientError( type: SyncIOApiType ): Error { return new Error( - `Route "${route}": Next.js encountered ${expression} in a Client Component.\n\n` + - `This value would be evaluated during the prerender and fixed at build time, instead of recomputed on each visit.\n\n` + + `Route "${route}": Next.js encountered the unstable value ${expression} in a Client Component.\n\n` + + `This value would be evaluated during the prerender, instead of recomputed on each visit.\n\n` + `Ways to fix this:\n` + ` - Wrap the Client Component in \`\`\n` + ` - Move the read into a \`useEffect\` or event handler\n` + + elapsedTimeBullet(type) + `\n` + `Learn more: ${SYNC_IO_CLIENT_DOCS[type]}` ) diff --git a/test/development/app-dir/cache-components-dev-cache-scope/cache-components-dev-cache-scope.test.ts b/test/development/app-dir/cache-components-dev-cache-scope/cache-components-dev-cache-scope.test.ts index 59306d0f7f82..8ffd60f4f7f4 100644 --- a/test/development/app-dir/cache-components-dev-cache-scope/cache-components-dev-cache-scope.test.ts +++ b/test/development/app-dir/cache-components-dev-cache-scope/cache-components-dev-cache-scope.test.ts @@ -75,12 +75,12 @@ describe('Cache Components Dev Errors', () => { await openRedbox(browser) desc = await getRedboxDescription(browser) - expect(desc).toContain('during the initial render') + expect(desc).toContain('during prerendering') await browser.refresh() await openRedbox(browser) desc = await getRedboxDescription(browser) - expect(desc).toContain('during the initial render') + expect(desc).toContain('during prerendering') }) }) diff --git a/test/development/app-dir/cache-components-dev-errors/cache-components-dev-errors.test.ts b/test/development/app-dir/cache-components-dev-errors/cache-components-dev-errors.test.ts index b5125ab89b32..f1d829fcf6e8 100644 --- a/test/development/app-dir/cache-components-dev-errors/cache-components-dev-errors.test.ts +++ b/test/development/app-dir/cache-components-dev-errors/cache-components-dev-errors.test.ts @@ -21,8 +21,8 @@ describe('Cache Components Dev Errors', () => { // soft-navigating to the page (see test below). await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", - "description": "Next.js encountered Math.random() without an explicit rendering intent.", + "code": "E1261", + "description": "Next.js encountered the unstable value Math.random() while prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/error/page.tsx (2:23) @ Page @@ -51,8 +51,8 @@ describe('Cache Components Dev Errors', () => { // TODO: React should not include the anon stack in the Owner Stack. await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", - "description": "Next.js encountered Math.random() without an explicit rendering intent.", + "code": "E1261", + "description": "Next.js encountered the unstable value Math.random() while prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/error/page.tsx (2:23) @ Page @@ -98,8 +98,8 @@ describe('Cache Components Dev Errors', () => { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1220", - "description": "Next.js encountered uncached data during the initial render.", + "code": "E1265", + "description": "Next.js encountered uncached data during prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/no-accessed-data/page.js (2:9) @ Page diff --git a/test/development/app-dir/cache-components-dev-fallback-validation/cache-components-dev-fallback-validation.test.ts b/test/development/app-dir/cache-components-dev-fallback-validation/cache-components-dev-fallback-validation.test.ts index 25a90576ebab..2b7658bab07a 100644 --- a/test/development/app-dir/cache-components-dev-fallback-validation/cache-components-dev-fallback-validation.test.ts +++ b/test/development/app-dir/cache-components-dev-fallback-validation/cache-components-dev-fallback-validation.test.ts @@ -52,8 +52,8 @@ describe('Cache Components Fallback Validation', () => { if (isTurbopack) { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1272", + "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/partial/[top]/unwrapped/[bottom]/page.tsx (6:26) @ Page @@ -67,8 +67,8 @@ describe('Cache Components Fallback Validation', () => { } else { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1272", + "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/partial/[top]/unwrapped/[bottom]/page.tsx (6:26) @ Page @@ -85,8 +85,8 @@ describe('Cache Components Fallback Validation', () => { if (isTurbopack) { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1272", + "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/partial/[top]/unwrapped/[bottom]/page.tsx (6:26) @ Page @@ -100,8 +100,8 @@ describe('Cache Components Fallback Validation', () => { } else { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1272", + "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/partial/[top]/unwrapped/[bottom]/page.tsx (6:26) @ Page @@ -118,8 +118,8 @@ describe('Cache Components Fallback Validation', () => { if (isTurbopack) { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1272", + "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/partial/[top]/unwrapped/[bottom]/page.tsx (6:26) @ Page @@ -133,8 +133,8 @@ describe('Cache Components Fallback Validation', () => { } else { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1272", + "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/partial/[top]/unwrapped/[bottom]/page.tsx (6:26) @ Page @@ -155,8 +155,8 @@ describe('Cache Components Fallback Validation', () => { if (isTurbopack) { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1272", + "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/none/[top]/wrapped/layout.tsx (10:3) @ Layout @@ -170,8 +170,8 @@ describe('Cache Components Fallback Validation', () => { } else { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1272", + "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/none/[top]/wrapped/layout.tsx (10:3) @ Layout @@ -188,8 +188,8 @@ describe('Cache Components Fallback Validation', () => { if (isTurbopack) { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1272", + "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/none/[top]/wrapped/layout.tsx (10:3) @ Layout @@ -203,8 +203,8 @@ describe('Cache Components Fallback Validation', () => { } else { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1272", + "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/none/[top]/wrapped/layout.tsx (10:3) @ Layout @@ -221,8 +221,8 @@ describe('Cache Components Fallback Validation', () => { if (isTurbopack) { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1272", + "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/none/[top]/wrapped/layout.tsx (10:3) @ Layout @@ -236,8 +236,8 @@ describe('Cache Components Fallback Validation', () => { } else { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1272", + "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/none/[top]/wrapped/layout.tsx (10:3) @ Layout @@ -254,8 +254,8 @@ describe('Cache Components Fallback Validation', () => { if (isTurbopack) { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1272", + "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/none/[top]/unwrapped/layout.tsx (8:3) @ Layout @@ -269,8 +269,8 @@ describe('Cache Components Fallback Validation', () => { } else { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1272", + "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/none/[top]/unwrapped/layout.tsx (8:3) @ Layout @@ -287,8 +287,8 @@ describe('Cache Components Fallback Validation', () => { if (isTurbopack) { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1272", + "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/none/[top]/unwrapped/layout.tsx (8:3) @ Layout @@ -302,8 +302,8 @@ describe('Cache Components Fallback Validation', () => { } else { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1272", + "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/none/[top]/unwrapped/layout.tsx (8:3) @ Layout @@ -320,8 +320,8 @@ describe('Cache Components Fallback Validation', () => { if (isTurbopack) { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1272", + "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/none/[top]/unwrapped/layout.tsx (8:3) @ Layout @@ -335,8 +335,8 @@ describe('Cache Components Fallback Validation', () => { } else { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1272", + "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/none/[top]/unwrapped/layout.tsx (8:3) @ Layout diff --git a/test/e2e/app-dir/cache-components-errors/cache-components-errors.test.ts b/test/e2e/app-dir/cache-components-errors/cache-components-errors.test.ts index b42ee94dfb80..83c0236237f8 100644 --- a/test/e2e/app-dir/cache-components-errors/cache-components-errors.test.ts +++ b/test/e2e/app-dir/cache-components-errors/cache-components-errors.test.ts @@ -158,8 +158,8 @@ describe('Cache Components Errors', () => { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1220", - "description": "Next.js encountered uncached data during the initial render.", + "code": "E1265", + "description": "Next.js encountered uncached data during prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/dynamic-metadata-error-route/page.tsx (21:9) @ Dynamic @@ -189,14 +189,14 @@ describe('Cache Components Errors', () => { if (isTurbopack) { if (isDebugPrerender) { expect(output).toMatchInlineSnapshot(` - "Error: Route "/dynamic-metadata-error-route": Next.js encountered uncached or runtime data during the initial render. + "Error: Route "/dynamic-metadata-error-route": Next.js encountered uncached or runtime data during prerendering. - \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience. Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -217,14 +217,14 @@ describe('Cache Components Errors', () => { `) } else { expect(output).toMatchInlineSnapshot(` - "Error: Route "/dynamic-metadata-error-route": Next.js encountered uncached or runtime data during the initial render. + "Error: Route "/dynamic-metadata-error-route": Next.js encountered uncached or runtime data during prerendering. - \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience. Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -241,14 +241,14 @@ describe('Cache Components Errors', () => { } else { if (isDebugPrerender) { expect(output).toMatchInlineSnapshot(` - "Error: Route "/dynamic-metadata-error-route": Next.js encountered uncached or runtime data during the initial render. + "Error: Route "/dynamic-metadata-error-route": Next.js encountered uncached or runtime data during prerendering. - \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience. Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -269,14 +269,14 @@ describe('Cache Components Errors', () => { `) } else { expect(output).toMatchInlineSnapshot(` - "Error: Route "/dynamic-metadata-error-route": Next.js encountered uncached or runtime data during the initial render. + "Error: Route "/dynamic-metadata-error-route": Next.js encountered uncached or runtime data during prerendering. - \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience. Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -566,7 +566,7 @@ describe('Cache Components Errors', () => { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1210", + "code": "E1255", "description": "Next.js encountered uncached data in generateViewport().", "environmentLabel": "Server", "label": "Instant", @@ -601,7 +601,6 @@ describe('Cache Components Errors', () => { Ways to fix this: - Use a static viewport export instead of \`generateViewport()\` - Cache the viewport data with \`"use cache"\` in \`generateViewport()\` - - Wrap your document \`\` in \`\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/next-prerender-dynamic-viewport @@ -619,7 +618,6 @@ describe('Cache Components Errors', () => { Ways to fix this: - Use a static viewport export instead of \`generateViewport()\` - Cache the viewport data with \`"use cache"\` in \`generateViewport()\` - - Wrap your document \`\` in \`\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/next-prerender-dynamic-viewport @@ -678,7 +676,7 @@ describe('Cache Components Errors', () => { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1210", + "code": "E1255", "description": "Next.js encountered uncached data in generateViewport().", "environmentLabel": "Server", "label": "Instant", @@ -713,7 +711,6 @@ describe('Cache Components Errors', () => { Ways to fix this: - Use a static viewport export instead of \`generateViewport()\` - Cache the viewport data with \`"use cache"\` in \`generateViewport()\` - - Wrap your document \`\` in \`\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/next-prerender-dynamic-viewport @@ -731,7 +728,6 @@ describe('Cache Components Errors', () => { Ways to fix this: - Use a static viewport export instead of \`generateViewport()\` - Cache the viewport data with \`"use cache"\` in \`generateViewport()\` - - Wrap your document \`\` in \`\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/next-prerender-dynamic-viewport @@ -772,8 +768,8 @@ describe('Cache Components Errors', () => { await expect(browser).toDisplayCollapsedRedbox(` [ { - "code": "E1220", - "description": "Next.js encountered uncached data during the initial render.", + "code": "E1265", + "description": "Next.js encountered uncached data during prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/dynamic-root/page.tsx (63:26) @ fetchRandom @@ -786,8 +782,8 @@ describe('Cache Components Errors', () => { ], }, { - "code": "E1220", - "description": "Next.js encountered uncached data during the initial render.", + "code": "E1265", + "description": "Next.js encountered uncached data during prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/dynamic-root/page.tsx (63:26) @ fetchRandom @@ -818,14 +814,14 @@ describe('Cache Components Errors', () => { if (isTurbopack) { if (isDebugPrerender) { expect(output).toMatchInlineSnapshot(` - "Error: Route "/dynamic-root": Next.js encountered uncached or runtime data during the initial render. + "Error: Route "/dynamic-root": Next.js encountered uncached or runtime data during prerendering. - \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience. Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -840,14 +836,14 @@ describe('Cache Components Errors', () => { 64 | 'https://next-data-api-endpoint.vercel.app/api/random?b=' + entropy 65 | ) To debug the issue, start the app in development mode by running \`next dev\`, then open "/dynamic-root" in your browser to investigate the error. - Error: Route "/dynamic-root": Next.js encountered uncached or runtime data during the initial render. + Error: Route "/dynamic-root": Next.js encountered uncached or runtime data during prerendering. - \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience. Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -869,14 +865,14 @@ describe('Cache Components Errors', () => { `) } else { expect(output).toMatchInlineSnapshot(` - "Error: Route "/dynamic-root": Next.js encountered uncached or runtime data during the initial render. + "Error: Route "/dynamic-root": Next.js encountered uncached or runtime data during prerendering. - \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience. Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -894,14 +890,14 @@ describe('Cache Components Errors', () => { To get a more detailed stack trace and pinpoint the issue, try one of the following: - Start the app in development mode by running \`next dev\`, then open "/dynamic-root" in your browser to investigate the error. - Rerun the production build with \`next build --debug-prerender\` to generate better stack traces. - Error: Route "/dynamic-root": Next.js encountered uncached or runtime data during the initial render. + Error: Route "/dynamic-root": Next.js encountered uncached or runtime data during prerendering. - \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience. Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -918,14 +914,14 @@ describe('Cache Components Errors', () => { } else { if (isDebugPrerender) { expect(output).toMatchInlineSnapshot(` - "Error: Route "/dynamic-root": Next.js encountered uncached or runtime data during the initial render. + "Error: Route "/dynamic-root": Next.js encountered uncached or runtime data during prerendering. - \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience. Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -940,14 +936,14 @@ describe('Cache Components Errors', () => { 64 | 'https://next-data-api-endpoint.vercel.app/api/random?b=' + entropy 65 | ) To debug the issue, start the app in development mode by running \`next dev\`, then open "/dynamic-root" in your browser to investigate the error. - Error: Route "/dynamic-root": Next.js encountered uncached or runtime data during the initial render. + Error: Route "/dynamic-root": Next.js encountered uncached or runtime data during prerendering. - \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience. Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -969,14 +965,14 @@ describe('Cache Components Errors', () => { `) } else { expect(output).toMatchInlineSnapshot(` - "Error: Route "/dynamic-root": Next.js encountered uncached or runtime data during the initial render. + "Error: Route "/dynamic-root": Next.js encountered uncached or runtime data during prerendering. - \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience. Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -1008,14 +1004,14 @@ describe('Cache Components Errors', () => { To get a more detailed stack trace and pinpoint the issue, try one of the following: - Start the app in development mode by running \`next dev\`, then open "/dynamic-root" in your browser to investigate the error. - Rerun the production build with \`next build --debug-prerender\` to generate better stack traces. - Error: Route "/dynamic-root": Next.js encountered uncached or runtime data during the initial render. + Error: Route "/dynamic-root": Next.js encountered uncached or runtime data during prerendering. - \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience. Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -1093,8 +1089,8 @@ describe('Cache Components Errors', () => { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", - "description": "Next.js encountered Math.random() without an explicit rendering intent.", + "code": "E1261", + "description": "Next.js encountered the unstable value Math.random() while prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/sync-random-with-fallback/page.tsx (37:23) @ RandomReadingComponent @@ -1123,7 +1119,7 @@ describe('Cache Components Errors', () => { if (isDebugPrerender) { if (isTurbopack) { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-random-with-fallback": Next.js encountered \`Math.random()\` without an explicit rendering intent. + "Error: Route "/sync-random-with-fallback": Next.js encountered the unstable value \`Math.random()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -1150,7 +1146,7 @@ describe('Cache Components Errors', () => { `) } else { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-random-with-fallback": Next.js encountered \`Math.random()\` without an explicit rendering intent. + "Error: Route "/sync-random-with-fallback": Next.js encountered the unstable value \`Math.random()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -1179,7 +1175,7 @@ describe('Cache Components Errors', () => { } else { if (isTurbopack) { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-random-with-fallback": Next.js encountered \`Math.random()\` without an explicit rendering intent. + "Error: Route "/sync-random-with-fallback": Next.js encountered the unstable value \`Math.random()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -1205,7 +1201,7 @@ describe('Cache Components Errors', () => { `) } else { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-random-with-fallback": Next.js encountered \`Math.random()\` without an explicit rendering intent. + "Error: Route "/sync-random-with-fallback": Next.js encountered the unstable value \`Math.random()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -1241,8 +1237,8 @@ describe('Cache Components Errors', () => { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", - "description": "Next.js encountered Math.random() without an explicit rendering intent.", + "code": "E1261", + "description": "Next.js encountered the unstable value Math.random() while prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/sync-random-without-fallback/page.tsx (32:15) @ getRandomNumber @@ -1272,7 +1268,7 @@ describe('Cache Components Errors', () => { if (isDebugPrerender) { if (isTurbopack) { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-random-without-fallback": Next.js encountered \`Math.random()\` without an explicit rendering intent. + "Error: Route "/sync-random-without-fallback": Next.js encountered the unstable value \`Math.random()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -1300,7 +1296,7 @@ describe('Cache Components Errors', () => { `) } else { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-random-without-fallback": Next.js encountered \`Math.random()\` without an explicit rendering intent. + "Error: Route "/sync-random-without-fallback": Next.js encountered the unstable value \`Math.random()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -1330,7 +1326,7 @@ describe('Cache Components Errors', () => { } else { if (isTurbopack) { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-random-without-fallback": Next.js encountered \`Math.random()\` without an explicit rendering intent. + "Error: Route "/sync-random-without-fallback": Next.js encountered the unstable value \`Math.random()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -1356,7 +1352,7 @@ describe('Cache Components Errors', () => { `) } else { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-random-without-fallback": Next.js encountered \`Math.random()\` without an explicit rendering intent. + "Error: Route "/sync-random-without-fallback": Next.js encountered the unstable value \`Math.random()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -2181,8 +2177,8 @@ describe('Cache Components Errors', () => { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1228", - "description": "Next.js encountered new Date() in a Client Component.", + "code": "E1266", + "description": "Next.js encountered the unstable value new Date() in a Client Component.", "environmentLabel": "Server", "label": "Instant", "source": "app/sync-attribution/guarded-async-unguarded-clientsync/client.tsx (5:16) @ SyncIO @@ -2211,13 +2207,14 @@ describe('Cache Components Errors', () => { if (isDebugPrerender) { if (isTurbopack) { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-attribution/guarded-async-unguarded-clientsync": Next.js encountered \`new Date()\` in a Client Component. + "Error: Route "/sync-attribution/guarded-async-unguarded-clientsync": Next.js encountered the unstable value \`new Date()\` in a Client Component. - This value would be evaluated during the prerender and fixed at build time, instead of recomputed on each visit. + This value would be evaluated during the prerender, instead of recomputed on each visit. Ways to fix this: - Wrap the Client Component in \`\` - Move the read into a \`useEffect\` or event handler + - If the value is for telemetry, use a timing API such as \`performance.now()\` Learn more: https://nextjs.org/docs/messages/next-prerender-current-time-client at SyncIO (app/sync-attribution/guarded-async-unguarded-clientsync/client.tsx:5:16) @@ -2237,13 +2234,14 @@ describe('Cache Components Errors', () => { `) } else { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-attribution/guarded-async-unguarded-clientsync": Next.js encountered \`new Date()\` in a Client Component. + "Error: Route "/sync-attribution/guarded-async-unguarded-clientsync": Next.js encountered the unstable value \`new Date()\` in a Client Component. - This value would be evaluated during the prerender and fixed at build time, instead of recomputed on each visit. + This value would be evaluated during the prerender, instead of recomputed on each visit. Ways to fix this: - Wrap the Client Component in \`\` - Move the read into a \`useEffect\` or event handler + - If the value is for telemetry, use a timing API such as \`performance.now()\` Learn more: https://nextjs.org/docs/messages/next-prerender-current-time-client at SyncIO (webpack:///app/sync-attribution/guarded-async-unguarded-clientsync/client.tsx:5:16) @@ -2265,13 +2263,14 @@ describe('Cache Components Errors', () => { } else { if (isTurbopack) { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-attribution/guarded-async-unguarded-clientsync": Next.js encountered \`new Date()\` in a Client Component. + "Error: Route "/sync-attribution/guarded-async-unguarded-clientsync": Next.js encountered the unstable value \`new Date()\` in a Client Component. - This value would be evaluated during the prerender and fixed at build time, instead of recomputed on each visit. + This value would be evaluated during the prerender, instead of recomputed on each visit. Ways to fix this: - Wrap the Client Component in \`\` - Move the read into a \`useEffect\` or event handler + - If the value is for telemetry, use a timing API such as \`performance.now()\` Learn more: https://nextjs.org/docs/messages/next-prerender-current-time-client at (app/sync-attribution/guarded-async-unguarded-clientsync/client.tsx:5:16) @@ -2290,13 +2289,14 @@ describe('Cache Components Errors', () => { `) } else { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-attribution/guarded-async-unguarded-clientsync": Next.js encountered \`new Date()\` in a Client Component. + "Error: Route "/sync-attribution/guarded-async-unguarded-clientsync": Next.js encountered the unstable value \`new Date()\` in a Client Component. - This value would be evaluated during the prerender and fixed at build time, instead of recomputed on each visit. + This value would be evaluated during the prerender, instead of recomputed on each visit. Ways to fix this: - Wrap the Client Component in \`\` - Move the read into a \`useEffect\` or event handler + - If the value is for telemetry, use a timing API such as \`performance.now()\` Learn more: https://nextjs.org/docs/messages/next-prerender-current-time-client at a () @@ -2325,8 +2325,8 @@ describe('Cache Components Errors', () => { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1272", + "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/sync-attribution/unguarded-async-guarded-clientsync/page.tsx (34:18) @ RequestData @@ -2355,14 +2355,14 @@ describe('Cache Components Errors', () => { if (isTurbopack) { if (isDebugPrerender) { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-attribution/unguarded-async-guarded-clientsync": Next.js encountered uncached or runtime data during the initial render. + "Error: Route "/sync-attribution/unguarded-async-guarded-clientsync": Next.js encountered uncached or runtime data during prerendering. - \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience. Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -2383,14 +2383,14 @@ describe('Cache Components Errors', () => { `) } else { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-attribution/unguarded-async-guarded-clientsync": Next.js encountered uncached or runtime data during the initial render. + "Error: Route "/sync-attribution/unguarded-async-guarded-clientsync": Next.js encountered uncached or runtime data during prerendering. - \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience. Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -2409,14 +2409,14 @@ describe('Cache Components Errors', () => { } else { if (isDebugPrerender) { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-attribution/unguarded-async-guarded-clientsync": Next.js encountered uncached or runtime data during the initial render. + "Error: Route "/sync-attribution/unguarded-async-guarded-clientsync": Next.js encountered uncached or runtime data during prerendering. - \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience. Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -2441,7 +2441,7 @@ describe('Cache Components Errors', () => { // non-debug-prerender mode, so we don't assert on the stack // frames here. expect(output).toInclude( - 'Error: Route "/sync-attribution/unguarded-async-guarded-clientsync": Next.js encountered uncached or runtime data during the initial render.' + 'Error: Route "/sync-attribution/unguarded-async-guarded-clientsync": Next.js encountered uncached or runtime data during prerendering.' ) } } @@ -2463,8 +2463,8 @@ describe('Cache Components Errors', () => { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1228", - "description": "Next.js encountered new Date() in a Client Component.", + "code": "E1266", + "description": "Next.js encountered the unstable value new Date() in a Client Component.", "environmentLabel": "Server", "label": "Instant", "source": "app/sync-attribution/unguarded-async-unguarded-clientsync/client.tsx (5:16) @ SyncIO @@ -2493,13 +2493,14 @@ describe('Cache Components Errors', () => { if (isDebugPrerender) { if (isTurbopack) { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-attribution/unguarded-async-unguarded-clientsync": Next.js encountered \`new Date()\` in a Client Component. + "Error: Route "/sync-attribution/unguarded-async-unguarded-clientsync": Next.js encountered the unstable value \`new Date()\` in a Client Component. - This value would be evaluated during the prerender and fixed at build time, instead of recomputed on each visit. + This value would be evaluated during the prerender, instead of recomputed on each visit. Ways to fix this: - Wrap the Client Component in \`\` - Move the read into a \`useEffect\` or event handler + - If the value is for telemetry, use a timing API such as \`performance.now()\` Learn more: https://nextjs.org/docs/messages/next-prerender-current-time-client at SyncIO (app/sync-attribution/unguarded-async-unguarded-clientsync/client.tsx:5:16) @@ -2519,13 +2520,14 @@ describe('Cache Components Errors', () => { `) } else { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-attribution/unguarded-async-unguarded-clientsync": Next.js encountered \`new Date()\` in a Client Component. + "Error: Route "/sync-attribution/unguarded-async-unguarded-clientsync": Next.js encountered the unstable value \`new Date()\` in a Client Component. - This value would be evaluated during the prerender and fixed at build time, instead of recomputed on each visit. + This value would be evaluated during the prerender, instead of recomputed on each visit. Ways to fix this: - Wrap the Client Component in \`\` - Move the read into a \`useEffect\` or event handler + - If the value is for telemetry, use a timing API such as \`performance.now()\` Learn more: https://nextjs.org/docs/messages/next-prerender-current-time-client at SyncIO (webpack:///app/sync-attribution/unguarded-async-unguarded-clientsync/client.tsx:5:16) @@ -2547,13 +2549,14 @@ describe('Cache Components Errors', () => { } else { if (isTurbopack) { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-attribution/unguarded-async-unguarded-clientsync": Next.js encountered \`new Date()\` in a Client Component. + "Error: Route "/sync-attribution/unguarded-async-unguarded-clientsync": Next.js encountered the unstable value \`new Date()\` in a Client Component. - This value would be evaluated during the prerender and fixed at build time, instead of recomputed on each visit. + This value would be evaluated during the prerender, instead of recomputed on each visit. Ways to fix this: - Wrap the Client Component in \`\` - Move the read into a \`useEffect\` or event handler + - If the value is for telemetry, use a timing API such as \`performance.now()\` Learn more: https://nextjs.org/docs/messages/next-prerender-current-time-client at (app/sync-attribution/unguarded-async-unguarded-clientsync/client.tsx:5:16) @@ -2572,13 +2575,14 @@ describe('Cache Components Errors', () => { `) } else { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-attribution/unguarded-async-unguarded-clientsync": Next.js encountered \`new Date()\` in a Client Component. + "Error: Route "/sync-attribution/unguarded-async-unguarded-clientsync": Next.js encountered the unstable value \`new Date()\` in a Client Component. - This value would be evaluated during the prerender and fixed at build time, instead of recomputed on each visit. + This value would be evaluated during the prerender, instead of recomputed on each visit. Ways to fix this: - Wrap the Client Component in \`\` - Move the read into a \`useEffect\` or event handler + - If the value is for telemetry, use a timing API such as \`performance.now()\` Learn more: https://nextjs.org/docs/messages/next-prerender-current-time-client at a () @@ -3037,8 +3041,8 @@ describe('Cache Components Errors', () => { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1272", + "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/use-cache-low-expire/fast/page.tsx (3:16) @ Page @@ -3066,14 +3070,14 @@ describe('Cache Components Errors', () => { if (isTurbopack) { if (isDebugPrerender) { expect(output).toMatchInlineSnapshot(` - "Error: Route "/use-cache-low-expire/fast": Next.js encountered uncached or runtime data during the initial render. + "Error: Route "/use-cache-low-expire/fast": Next.js encountered uncached or runtime data during prerendering. - \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience. Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -3093,14 +3097,14 @@ describe('Cache Components Errors', () => { `) } else { expect(output).toMatchInlineSnapshot(` - "Error: Route "/use-cache-low-expire/fast": Next.js encountered uncached or runtime data during the initial render. + "Error: Route "/use-cache-low-expire/fast": Next.js encountered uncached or runtime data during prerendering. - \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience. Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -3120,28 +3124,28 @@ describe('Cache Components Errors', () => { // Next.js internals, and is also flaky on resolving the exact // location, so we don't assert on the stack frames here. expect(output).toInclude( - `Error: Route "/use-cache-low-expire/fast": Next.js encountered uncached or runtime data during the initial render. + `Error: Route "/use-cache-low-expire/fast": Next.js encountered uncached or runtime data during prerendering. -\`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. +\`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience. Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route` ) } else { expect(output).toInclude( - `Error: Route "/use-cache-low-expire/fast": Next.js encountered uncached or runtime data during the initial render. + `Error: Route "/use-cache-low-expire/fast": Next.js encountered uncached or runtime data during prerendering. -\`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. +\`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience. Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route` @@ -3159,8 +3163,8 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1272", + "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/use-cache-low-expire/slow/page.tsx (3:16) @ Page @@ -3188,14 +3192,14 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` if (isTurbopack) { if (isDebugPrerender) { expect(output).toMatchInlineSnapshot(` - "Error: Route "/use-cache-low-expire/slow": Next.js encountered uncached or runtime data during the initial render. + "Error: Route "/use-cache-low-expire/slow": Next.js encountered uncached or runtime data during prerendering. - \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience. Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -3215,14 +3219,14 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` `) } else { expect(output).toMatchInlineSnapshot(` - "Error: Route "/use-cache-low-expire/slow": Next.js encountered uncached or runtime data during the initial render. + "Error: Route "/use-cache-low-expire/slow": Next.js encountered uncached or runtime data during prerendering. - \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience. Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -3242,28 +3246,28 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` // Next.js internals, and is also flaky on resolving the exact // location, so we don't assert on the stack frames here. expect(output).toInclude( - `Error: Route "/use-cache-low-expire/slow": Next.js encountered uncached or runtime data during the initial render. + `Error: Route "/use-cache-low-expire/slow": Next.js encountered uncached or runtime data during prerendering. -\`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. +\`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience. Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route` ) } else { expect(output).toInclude( - `Error: Route "/use-cache-low-expire/slow": Next.js encountered uncached or runtime data during the initial render. + `Error: Route "/use-cache-low-expire/slow": Next.js encountered uncached or runtime data during prerendering. -\`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. +\`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience. Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route` @@ -3440,8 +3444,8 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1272", + "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/use-cache-revalidate-0/fast/page.tsx (3:16) @ Page @@ -3469,14 +3473,14 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` if (isTurbopack) { if (isDebugPrerender) { expect(output).toMatchInlineSnapshot(` - "Error: Route "/use-cache-revalidate-0/fast": Next.js encountered uncached or runtime data during the initial render. + "Error: Route "/use-cache-revalidate-0/fast": Next.js encountered uncached or runtime data during prerendering. - \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience. Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -3496,14 +3500,14 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` `) } else { expect(output).toMatchInlineSnapshot(` - "Error: Route "/use-cache-revalidate-0/fast": Next.js encountered uncached or runtime data during the initial render. + "Error: Route "/use-cache-revalidate-0/fast": Next.js encountered uncached or runtime data during prerendering. - \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience. Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -3523,28 +3527,28 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` // Next.js internals, and is also flaky on resolving the exact // location, so we don't assert on the stack frames here. expect(output).toInclude( - `Error: Route "/use-cache-revalidate-0/fast": Next.js encountered uncached or runtime data during the initial render. + `Error: Route "/use-cache-revalidate-0/fast": Next.js encountered uncached or runtime data during prerendering. -\`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. +\`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience. Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route` ) } else { expect(output).toInclude( - `Error: Route "/use-cache-revalidate-0/fast": Next.js encountered uncached or runtime data during the initial render. + `Error: Route "/use-cache-revalidate-0/fast": Next.js encountered uncached or runtime data during prerendering. -\`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. +\`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience. Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route` @@ -3562,8 +3566,8 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1272", + "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/use-cache-revalidate-0/slow/page.tsx (3:16) @ Page @@ -3591,14 +3595,14 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` if (isTurbopack) { if (isDebugPrerender) { expect(output).toMatchInlineSnapshot(` - "Error: Route "/use-cache-revalidate-0/slow": Next.js encountered uncached or runtime data during the initial render. + "Error: Route "/use-cache-revalidate-0/slow": Next.js encountered uncached or runtime data during prerendering. - \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience. Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -3618,14 +3622,14 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` `) } else { expect(output).toMatchInlineSnapshot(` - "Error: Route "/use-cache-revalidate-0/slow": Next.js encountered uncached or runtime data during the initial render. + "Error: Route "/use-cache-revalidate-0/slow": Next.js encountered uncached or runtime data during prerendering. - \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience. Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -3645,28 +3649,28 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` // Next.js internals, and is also flaky on resolving the exact // location, so we don't assert on the stack frames here. expect(output).toInclude( - `Error: Route "/use-cache-revalidate-0/slow": Next.js encountered uncached or runtime data during the initial render. + `Error: Route "/use-cache-revalidate-0/slow": Next.js encountered uncached or runtime data during prerendering. -\`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. +\`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience. Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route` ) } else { expect(output).toInclude( - `Error: Route "/use-cache-revalidate-0/slow": Next.js encountered uncached or runtime data during the initial render. + `Error: Route "/use-cache-revalidate-0/slow": Next.js encountered uncached or runtime data during prerendering. -\`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. +\`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience. Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route` @@ -3844,8 +3848,8 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1272", + "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", "source": null, @@ -3871,14 +3875,14 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` if (isTurbopack) { if (isDebugPrerender) { expect(output).toMatchInlineSnapshot(` - "Error: Route "/use-cache-params/[slug]": Next.js encountered uncached or runtime data during the initial render. + "Error: Route "/use-cache-params/[slug]": Next.js encountered uncached or runtime data during prerendering. - \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience. Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -3896,14 +3900,14 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` `) } else { expect(output).toMatchInlineSnapshot(` - "Error: Route "/use-cache-params/[slug]": Next.js encountered uncached or runtime data during the initial render. + "Error: Route "/use-cache-params/[slug]": Next.js encountered uncached or runtime data during prerendering. - \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience. Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -3923,11 +3927,11 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` // Next.js internals, and is also flaky on resolving the exact // location, so we don't assert on the stack frames here. expect(output).toInclude( - `Error: Route "/use-cache-params/[slug]": Next.js encountered uncached or runtime data during the initial render.` + `Error: Route "/use-cache-params/[slug]": Next.js encountered uncached or runtime data during prerendering.` ) } else { expect(output).toInclude( - `Error: Route "/use-cache-params/[slug]": Next.js encountered uncached or runtime data during the initial render.` + `Error: Route "/use-cache-params/[slug]": Next.js encountered uncached or runtime data during prerendering.` ) } } @@ -4745,8 +4749,8 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1272", + "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/use-cache-private-without-suspense/page.tsx (15:1) @ Private @@ -4775,14 +4779,14 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` if (isTurbopack) { if (isDebugPrerender) { expect(output).toMatchInlineSnapshot(` - "Error: Route "/use-cache-private-without-suspense": Next.js encountered uncached or runtime data during the initial render. + "Error: Route "/use-cache-private-without-suspense": Next.js encountered uncached or runtime data during prerendering. - \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience. Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -4803,14 +4807,14 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` `) } else { expect(output).toMatchInlineSnapshot(` - "Error: Route "/use-cache-private-without-suspense": Next.js encountered uncached or runtime data during the initial render. + "Error: Route "/use-cache-private-without-suspense": Next.js encountered uncached or runtime data during prerendering. - \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience. Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -4830,28 +4834,28 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` // Next.js internals, and is also flaky on resolving the exact // location, so we don't assert on the stack frames here. expect(output).toInclude( - `Error: Route "/use-cache-private-without-suspense": Next.js encountered uncached or runtime data during the initial render. + `Error: Route "/use-cache-private-without-suspense": Next.js encountered uncached or runtime data during prerendering. -\`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. +\`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience. Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route` ) } else { expect(output).toMatchInlineSnapshot(` - "Error: Route "/use-cache-private-without-suspense": Next.js encountered uncached or runtime data during the initial render. + "Error: Route "/use-cache-private-without-suspense": Next.js encountered uncached or runtime data during prerendering. - \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience. Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -4948,8 +4952,8 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", - "description": "Next.js encountered Date() without an explicit rendering intent.", + "code": "E1261", + "description": "Next.js encountered the unstable value Date() while prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/sync-io-current-time/date/page.tsx (19:16) @ DateReadingComponent @@ -4978,7 +4982,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` if (isDebugPrerender) { if (isTurbopack) { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-current-time/date": Next.js encountered \`Date()\` without an explicit rendering intent. + "Error: Route "/sync-io-current-time/date": Next.js encountered the unstable value \`Date()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -4986,7 +4990,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` - Render at request time by adding a dynamic data access (e.g. \`await connection()\`) before this call - Prerender and cache the value with \`"use cache"\` - Render the value on the client with \`"use client"\` - - Measure elapsed time with \`performance.now()\` instead of \`Date.now()\` + - If the value is for telemetry, use a timing API such as \`performance.now()\` Learn more: https://nextjs.org/docs/messages/next-prerender-current-time at DateReadingComponent (app/sync-io-current-time/date/page.tsx:19:16) @@ -5005,7 +5009,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` `) } else { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-current-time/date": Next.js encountered \`Date()\` without an explicit rendering intent. + "Error: Route "/sync-io-current-time/date": Next.js encountered the unstable value \`Date()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -5013,7 +5017,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` - Render at request time by adding a dynamic data access (e.g. \`await connection()\`) before this call - Prerender and cache the value with \`"use cache"\` - Render the value on the client with \`"use client"\` - - Measure elapsed time with \`performance.now()\` instead of \`Date.now()\` + - If the value is for telemetry, use a timing API such as \`performance.now()\` Learn more: https://nextjs.org/docs/messages/next-prerender-current-time at DateReadingComponent (webpack:///app/sync-io-current-time/date/page.tsx:19:16) @@ -5034,7 +5038,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` } else { if (isTurbopack) { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-current-time/date": Next.js encountered \`Date()\` without an explicit rendering intent. + "Error: Route "/sync-io-current-time/date": Next.js encountered the unstable value \`Date()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -5042,7 +5046,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` - Render at request time by adding a dynamic data access (e.g. \`await connection()\`) before this call - Prerender and cache the value with \`"use cache"\` - Render the value on the client with \`"use client"\` - - Measure elapsed time with \`performance.now()\` instead of \`Date.now()\` + - If the value is for telemetry, use a timing API such as \`performance.now()\` Learn more: https://nextjs.org/docs/messages/next-prerender-current-time at a (app/sync-io-current-time/date/page.tsx:19:16) @@ -5060,7 +5064,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` `) } else { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-current-time/date": Next.js encountered \`Date()\` without an explicit rendering intent. + "Error: Route "/sync-io-current-time/date": Next.js encountered the unstable value \`Date()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -5068,7 +5072,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` - Render at request time by adding a dynamic data access (e.g. \`await connection()\`) before this call - Prerender and cache the value with \`"use cache"\` - Render the value on the client with \`"use client"\` - - Measure elapsed time with \`performance.now()\` instead of \`Date.now()\` + - If the value is for telemetry, use a timing API such as \`performance.now()\` Learn more: https://nextjs.org/docs/messages/next-prerender-current-time at a () @@ -5093,8 +5097,8 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", - "description": "Next.js encountered Date.now() without an explicit rendering intent.", + "code": "E1261", + "description": "Next.js encountered the unstable value Date.now() while prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/sync-io-current-time/date-now/page.tsx (19:21) @ DateReadingComponent @@ -5123,7 +5127,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` if (isDebugPrerender) { if (isTurbopack) { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-current-time/date-now": Next.js encountered \`Date.now()\` without an explicit rendering intent. + "Error: Route "/sync-io-current-time/date-now": Next.js encountered the unstable value \`Date.now()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -5131,7 +5135,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` - Render at request time by adding a dynamic data access (e.g. \`await connection()\`) before this call - Prerender and cache the value with \`"use cache"\` - Render the value on the client with \`"use client"\` - - Measure elapsed time with \`performance.now()\` instead of \`Date.now()\` + - If the value is for telemetry, use a timing API such as \`performance.now()\` Learn more: https://nextjs.org/docs/messages/next-prerender-current-time at DateReadingComponent (app/sync-io-current-time/date-now/page.tsx:19:21) @@ -5150,7 +5154,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` `) } else { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-current-time/date-now": Next.js encountered \`Date.now()\` without an explicit rendering intent. + "Error: Route "/sync-io-current-time/date-now": Next.js encountered the unstable value \`Date.now()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -5158,7 +5162,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` - Render at request time by adding a dynamic data access (e.g. \`await connection()\`) before this call - Prerender and cache the value with \`"use cache"\` - Render the value on the client with \`"use client"\` - - Measure elapsed time with \`performance.now()\` instead of \`Date.now()\` + - If the value is for telemetry, use a timing API such as \`performance.now()\` Learn more: https://nextjs.org/docs/messages/next-prerender-current-time at DateReadingComponent (webpack:///app/sync-io-current-time/date-now/page.tsx:19:21) @@ -5179,7 +5183,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` } else { if (isTurbopack) { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-current-time/date-now": Next.js encountered \`Date.now()\` without an explicit rendering intent. + "Error: Route "/sync-io-current-time/date-now": Next.js encountered the unstable value \`Date.now()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -5187,7 +5191,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` - Render at request time by adding a dynamic data access (e.g. \`await connection()\`) before this call - Prerender and cache the value with \`"use cache"\` - Render the value on the client with \`"use client"\` - - Measure elapsed time with \`performance.now()\` instead of \`Date.now()\` + - If the value is for telemetry, use a timing API such as \`performance.now()\` Learn more: https://nextjs.org/docs/messages/next-prerender-current-time at a (app/sync-io-current-time/date-now/page.tsx:19:21) @@ -5205,7 +5209,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` `) } else { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-current-time/date-now": Next.js encountered \`Date.now()\` without an explicit rendering intent. + "Error: Route "/sync-io-current-time/date-now": Next.js encountered the unstable value \`Date.now()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -5213,7 +5217,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` - Render at request time by adding a dynamic data access (e.g. \`await connection()\`) before this call - Prerender and cache the value with \`"use cache"\` - Render the value on the client with \`"use client"\` - - Measure elapsed time with \`performance.now()\` instead of \`Date.now()\` + - If the value is for telemetry, use a timing API such as \`performance.now()\` Learn more: https://nextjs.org/docs/messages/next-prerender-current-time at a () @@ -5238,8 +5242,8 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", - "description": "Next.js encountered new Date() without an explicit rendering intent.", + "code": "E1261", + "description": "Next.js encountered the unstable value new Date() while prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/sync-io-current-time/new-date/page.tsx (19:16) @ DateReadingComponent @@ -5268,7 +5272,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` if (isDebugPrerender) { if (isTurbopack) { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-current-time/new-date": Next.js encountered \`new Date()\` without an explicit rendering intent. + "Error: Route "/sync-io-current-time/new-date": Next.js encountered the unstable value \`new Date()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -5276,7 +5280,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` - Render at request time by adding a dynamic data access (e.g. \`await connection()\`) before this call - Prerender and cache the value with \`"use cache"\` - Render the value on the client with \`"use client"\` - - Measure elapsed time with \`performance.now()\` instead of \`Date.now()\` + - If the value is for telemetry, use a timing API such as \`performance.now()\` Learn more: https://nextjs.org/docs/messages/next-prerender-current-time at DateReadingComponent (app/sync-io-current-time/new-date/page.tsx:19:16) @@ -5295,7 +5299,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` `) } else { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-current-time/new-date": Next.js encountered \`new Date()\` without an explicit rendering intent. + "Error: Route "/sync-io-current-time/new-date": Next.js encountered the unstable value \`new Date()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -5303,7 +5307,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` - Render at request time by adding a dynamic data access (e.g. \`await connection()\`) before this call - Prerender and cache the value with \`"use cache"\` - Render the value on the client with \`"use client"\` - - Measure elapsed time with \`performance.now()\` instead of \`Date.now()\` + - If the value is for telemetry, use a timing API such as \`performance.now()\` Learn more: https://nextjs.org/docs/messages/next-prerender-current-time at DateReadingComponent (webpack:///app/sync-io-current-time/new-date/page.tsx:19:16) @@ -5324,7 +5328,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` } else { if (isTurbopack) { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-current-time/new-date": Next.js encountered \`new Date()\` without an explicit rendering intent. + "Error: Route "/sync-io-current-time/new-date": Next.js encountered the unstable value \`new Date()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -5332,7 +5336,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` - Render at request time by adding a dynamic data access (e.g. \`await connection()\`) before this call - Prerender and cache the value with \`"use cache"\` - Render the value on the client with \`"use client"\` - - Measure elapsed time with \`performance.now()\` instead of \`Date.now()\` + - If the value is for telemetry, use a timing API such as \`performance.now()\` Learn more: https://nextjs.org/docs/messages/next-prerender-current-time at a (app/sync-io-current-time/new-date/page.tsx:19:16) @@ -5350,7 +5354,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` `) } else { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-current-time/new-date": Next.js encountered \`new Date()\` without an explicit rendering intent. + "Error: Route "/sync-io-current-time/new-date": Next.js encountered the unstable value \`new Date()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -5358,7 +5362,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` - Render at request time by adding a dynamic data access (e.g. \`await connection()\`) before this call - Prerender and cache the value with \`"use cache"\` - Render the value on the client with \`"use client"\` - - Measure elapsed time with \`performance.now()\` instead of \`Date.now()\` + - If the value is for telemetry, use a timing API such as \`performance.now()\` Learn more: https://nextjs.org/docs/messages/next-prerender-current-time at a () @@ -5383,8 +5387,8 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", - "description": "Next.js encountered Math.random() without an explicit rendering intent.", + "code": "E1261", + "description": "Next.js encountered the unstable value Math.random() while prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/sync-io-random/math-random/page.tsx (19:21) @ SyncIOComponent @@ -5413,7 +5417,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` if (isDebugPrerender) { if (isTurbopack) { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-random/math-random": Next.js encountered \`Math.random()\` without an explicit rendering intent. + "Error: Route "/sync-io-random/math-random": Next.js encountered the unstable value \`Math.random()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -5439,7 +5443,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` `) } else { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-random/math-random": Next.js encountered \`Math.random()\` without an explicit rendering intent. + "Error: Route "/sync-io-random/math-random": Next.js encountered the unstable value \`Math.random()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -5467,7 +5471,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` } else { if (isTurbopack) { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-random/math-random": Next.js encountered \`Math.random()\` without an explicit rendering intent. + "Error: Route "/sync-io-random/math-random": Next.js encountered the unstable value \`Math.random()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -5492,7 +5496,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` `) } else { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-random/math-random": Next.js encountered \`Math.random()\` without an explicit rendering intent. + "Error: Route "/sync-io-random/math-random": Next.js encountered the unstable value \`Math.random()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -5524,8 +5528,8 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", - "description": "Next.js encountered crypto.getRandomValues() without an explicit rendering intent.", + "code": "E1261", + "description": "Next.js encountered the unstable value crypto.getRandomValues() while prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/sync-io-web-crypto/get-random-value/page.tsx (20:10) @ SyncIOComponent @@ -5554,7 +5558,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` if (isDebugPrerender) { if (isTurbopack) { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-web-crypto/get-random-value": Next.js encountered \`crypto.getRandomValues()\` without an explicit rendering intent. + "Error: Route "/sync-io-web-crypto/get-random-value": Next.js encountered the unstable value \`crypto.getRandomValues()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -5581,7 +5585,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` `) } else { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-web-crypto/get-random-value": Next.js encountered \`crypto.getRandomValues()\` without an explicit rendering intent. + "Error: Route "/sync-io-web-crypto/get-random-value": Next.js encountered the unstable value \`crypto.getRandomValues()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -5610,7 +5614,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` } else { if (isTurbopack) { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-web-crypto/get-random-value": Next.js encountered \`crypto.getRandomValues()\` without an explicit rendering intent. + "Error: Route "/sync-io-web-crypto/get-random-value": Next.js encountered the unstable value \`crypto.getRandomValues()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -5636,7 +5640,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` `) } else { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-web-crypto/get-random-value": Next.js encountered \`crypto.getRandomValues()\` without an explicit rendering intent. + "Error: Route "/sync-io-web-crypto/get-random-value": Next.js encountered the unstable value \`crypto.getRandomValues()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -5668,8 +5672,8 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", - "description": "Next.js encountered crypto.randomUUID() without an explicit rendering intent.", + "code": "E1261", + "description": "Next.js encountered the unstable value crypto.randomUUID() while prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/sync-io-web-crypto/random-uuid/page.tsx (19:23) @ SyncIOComponent @@ -5698,7 +5702,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` if (isDebugPrerender) { if (isTurbopack) { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-web-crypto/random-uuid": Next.js encountered \`crypto.randomUUID()\` without an explicit rendering intent. + "Error: Route "/sync-io-web-crypto/random-uuid": Next.js encountered the unstable value \`crypto.randomUUID()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -5724,7 +5728,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` `) } else { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-web-crypto/random-uuid": Next.js encountered \`crypto.randomUUID()\` without an explicit rendering intent. + "Error: Route "/sync-io-web-crypto/random-uuid": Next.js encountered the unstable value \`crypto.randomUUID()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -5752,7 +5756,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` } else { if (isTurbopack) { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-web-crypto/random-uuid": Next.js encountered \`crypto.randomUUID()\` without an explicit rendering intent. + "Error: Route "/sync-io-web-crypto/random-uuid": Next.js encountered the unstable value \`crypto.randomUUID()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -5777,7 +5781,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` `) } else { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-web-crypto/random-uuid": Next.js encountered \`crypto.randomUUID()\` without an explicit rendering intent. + "Error: Route "/sync-io-web-crypto/random-uuid": Next.js encountered the unstable value \`crypto.randomUUID()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -5810,8 +5814,8 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` if (isTurbopack) { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", - "description": "Next.js encountered require('node:crypto').generateKeyPairSync(...) without an explicit rendering intent.", + "code": "E1261", + "description": "Next.js encountered the unstable value require('node:crypto').generateKeyPairSync(...) while prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/sync-io-node-crypto/generate-key-pair-sync/page.tsx (20:24) @ SyncIOComponent @@ -5826,8 +5830,8 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` } else { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", - "description": "Next.js encountered require('node:crypto').generateKeyPairSync(...) without an explicit rendering intent.", + "code": "E1261", + "description": "Next.js encountered the unstable value require('node:crypto').generateKeyPairSync(...) while prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/sync-io-node-crypto/generate-key-pair-sync/page.tsx (20:17) @ SyncIOComponent @@ -5857,7 +5861,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` if (isTurbopack) { if (isDebugPrerender) { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-node-crypto/generate-key-pair-sync": Next.js encountered \`require('node:crypto').generateKeyPairSync(...)\` without an explicit rendering intent. + "Error: Route "/sync-io-node-crypto/generate-key-pair-sync": Next.js encountered the unstable value \`require('node:crypto').generateKeyPairSync(...)\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -5884,7 +5888,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` `) } else { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-node-crypto/generate-key-pair-sync": Next.js encountered \`require('node:crypto').generateKeyPairSync(...)\` without an explicit rendering intent. + "Error: Route "/sync-io-node-crypto/generate-key-pair-sync": Next.js encountered the unstable value \`require('node:crypto').generateKeyPairSync(...)\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -5912,7 +5916,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` } else { if (isDebugPrerender) { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-node-crypto/generate-key-pair-sync": Next.js encountered \`require('node:crypto').generateKeyPairSync(...)\` without an explicit rendering intent. + "Error: Route "/sync-io-node-crypto/generate-key-pair-sync": Next.js encountered the unstable value \`require('node:crypto').generateKeyPairSync(...)\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -5939,7 +5943,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` `) } else { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-node-crypto/generate-key-pair-sync": Next.js encountered \`require('node:crypto').generateKeyPairSync(...)\` without an explicit rendering intent. + "Error: Route "/sync-io-node-crypto/generate-key-pair-sync": Next.js encountered the unstable value \`require('node:crypto').generateKeyPairSync(...)\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -5972,8 +5976,8 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` if (isTurbopack) { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", - "description": "Next.js encountered require('node:crypto').generateKeySync(...) without an explicit rendering intent.", + "code": "E1261", + "description": "Next.js encountered the unstable value require('node:crypto').generateKeySync(...) while prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/sync-io-node-crypto/generate-key-sync/page.tsx (21:6) @ SyncIOComponent @@ -5988,8 +5992,8 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` } else { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", - "description": "Next.js encountered require('node:crypto').generateKeySync(...) without an explicit rendering intent.", + "code": "E1261", + "description": "Next.js encountered the unstable value require('node:crypto').generateKeySync(...) while prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/sync-io-node-crypto/generate-key-sync/page.tsx (20:17) @ SyncIOComponent @@ -6019,7 +6023,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` if (isTurbopack) { if (isDebugPrerender) { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-node-crypto/generate-key-sync": Next.js encountered \`require('node:crypto').generateKeySync(...)\` without an explicit rendering intent. + "Error: Route "/sync-io-node-crypto/generate-key-sync": Next.js encountered the unstable value \`require('node:crypto').generateKeySync(...)\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -6046,7 +6050,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` `) } else { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-node-crypto/generate-key-sync": Next.js encountered \`require('node:crypto').generateKeySync(...)\` without an explicit rendering intent. + "Error: Route "/sync-io-node-crypto/generate-key-sync": Next.js encountered the unstable value \`require('node:crypto').generateKeySync(...)\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -6074,7 +6078,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` } else { if (isDebugPrerender) { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-node-crypto/generate-key-sync": Next.js encountered \`require('node:crypto').generateKeySync(...)\` without an explicit rendering intent. + "Error: Route "/sync-io-node-crypto/generate-key-sync": Next.js encountered the unstable value \`require('node:crypto').generateKeySync(...)\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -6101,7 +6105,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` `) } else { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-node-crypto/generate-key-sync": Next.js encountered \`require('node:crypto').generateKeySync(...)\` without an explicit rendering intent. + "Error: Route "/sync-io-node-crypto/generate-key-sync": Next.js encountered the unstable value \`require('node:crypto').generateKeySync(...)\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -6134,8 +6138,8 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` if (isTurbopack) { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", - "description": "Next.js encountered require('node:crypto').generatePrimeSync(...) without an explicit rendering intent.", + "code": "E1261", + "description": "Next.js encountered the unstable value require('node:crypto').generatePrimeSync(...) while prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/sync-io-node-crypto/generate-prime-sync/page.tsx (20:39) @ SyncIOComponent @@ -6150,8 +6154,8 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` } else { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", - "description": "Next.js encountered require('node:crypto').generatePrimeSync(...) without an explicit rendering intent.", + "code": "E1261", + "description": "Next.js encountered the unstable value require('node:crypto').generatePrimeSync(...) while prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/sync-io-node-crypto/generate-prime-sync/page.tsx (20:32) @ SyncIOComponent @@ -6181,7 +6185,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` if (isTurbopack) { if (isDebugPrerender) { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-node-crypto/generate-prime-sync": Next.js encountered \`require('node:crypto').generatePrimeSync(...)\` without an explicit rendering intent. + "Error: Route "/sync-io-node-crypto/generate-prime-sync": Next.js encountered the unstable value \`require('node:crypto').generatePrimeSync(...)\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -6208,7 +6212,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` `) } else { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-node-crypto/generate-prime-sync": Next.js encountered \`require('node:crypto').generatePrimeSync(...)\` without an explicit rendering intent. + "Error: Route "/sync-io-node-crypto/generate-prime-sync": Next.js encountered the unstable value \`require('node:crypto').generatePrimeSync(...)\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -6236,7 +6240,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` } else { if (isDebugPrerender) { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-node-crypto/generate-prime-sync": Next.js encountered \`require('node:crypto').generatePrimeSync(...)\` without an explicit rendering intent. + "Error: Route "/sync-io-node-crypto/generate-prime-sync": Next.js encountered the unstable value \`require('node:crypto').generatePrimeSync(...)\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -6263,7 +6267,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` `) } else { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-node-crypto/generate-prime-sync": Next.js encountered \`require('node:crypto').generatePrimeSync(...)\` without an explicit rendering intent. + "Error: Route "/sync-io-node-crypto/generate-prime-sync": Next.js encountered the unstable value \`require('node:crypto').generatePrimeSync(...)\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -6296,8 +6300,8 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` if (isTurbopack) { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", - "description": "Next.js encountered crypto.getRandomValues() without an explicit rendering intent.", + "code": "E1261", + "description": "Next.js encountered the unstable value crypto.getRandomValues() while prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/sync-io-node-crypto/get-random-values/page.tsx (21:10) @ SyncIOComponent @@ -6312,8 +6316,8 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` } else { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", - "description": "Next.js encountered crypto.getRandomValues() without an explicit rendering intent.", + "code": "E1261", + "description": "Next.js encountered the unstable value crypto.getRandomValues() while prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/sync-io-node-crypto/get-random-values/page.tsx (21:3) @ SyncIOComponent @@ -6343,7 +6347,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` if (isTurbopack) { if (isDebugPrerender) { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-node-crypto/get-random-values": Next.js encountered \`crypto.getRandomValues()\` without an explicit rendering intent. + "Error: Route "/sync-io-node-crypto/get-random-values": Next.js encountered the unstable value \`crypto.getRandomValues()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -6370,7 +6374,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` `) } else { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-node-crypto/get-random-values": Next.js encountered \`crypto.getRandomValues()\` without an explicit rendering intent. + "Error: Route "/sync-io-node-crypto/get-random-values": Next.js encountered the unstable value \`crypto.getRandomValues()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -6398,7 +6402,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` } else { if (isDebugPrerender) { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-node-crypto/get-random-values": Next.js encountered \`crypto.getRandomValues()\` without an explicit rendering intent. + "Error: Route "/sync-io-node-crypto/get-random-values": Next.js encountered the unstable value \`crypto.getRandomValues()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -6425,7 +6429,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` `) } else { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-node-crypto/get-random-values": Next.js encountered \`crypto.getRandomValues()\` without an explicit rendering intent. + "Error: Route "/sync-io-node-crypto/get-random-values": Next.js encountered the unstable value \`crypto.getRandomValues()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -6458,8 +6462,8 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` if (isTurbopack) { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", - "description": "Next.js encountered require('node:crypto').randomBytes(size) without an explicit rendering intent.", + "code": "E1261", + "description": "Next.js encountered the unstable value require('node:crypto').randomBytes(size) while prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/sync-io-node-crypto/random-bytes/page.tsx (20:24) @ SyncIOComponent @@ -6474,8 +6478,8 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` } else { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", - "description": "Next.js encountered require('node:crypto').randomBytes(size) without an explicit rendering intent.", + "code": "E1261", + "description": "Next.js encountered the unstable value require('node:crypto').randomBytes(size) while prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/sync-io-node-crypto/random-bytes/page.tsx (20:17) @ SyncIOComponent @@ -6505,7 +6509,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` if (isTurbopack) { if (isDebugPrerender) { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-node-crypto/random-bytes": Next.js encountered \`require('node:crypto').randomBytes(size)\` without an explicit rendering intent. + "Error: Route "/sync-io-node-crypto/random-bytes": Next.js encountered the unstable value \`require('node:crypto').randomBytes(size)\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -6532,7 +6536,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` `) } else { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-node-crypto/random-bytes": Next.js encountered \`require('node:crypto').randomBytes(size)\` without an explicit rendering intent. + "Error: Route "/sync-io-node-crypto/random-bytes": Next.js encountered the unstable value \`require('node:crypto').randomBytes(size)\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -6560,7 +6564,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` } else { if (isDebugPrerender) { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-node-crypto/random-bytes": Next.js encountered \`require('node:crypto').randomBytes(size)\` without an explicit rendering intent. + "Error: Route "/sync-io-node-crypto/random-bytes": Next.js encountered the unstable value \`require('node:crypto').randomBytes(size)\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -6587,7 +6591,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` `) } else { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-node-crypto/random-bytes": Next.js encountered \`require('node:crypto').randomBytes(size)\` without an explicit rendering intent. + "Error: Route "/sync-io-node-crypto/random-bytes": Next.js encountered the unstable value \`require('node:crypto').randomBytes(size)\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -6620,8 +6624,8 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` if (isTurbopack) { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", - "description": "Next.js encountered require('node:crypto').randomFillSync(...) without an explicit rendering intent.", + "code": "E1261", + "description": "Next.js encountered the unstable value require('node:crypto').randomFillSync(...) while prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/sync-io-node-crypto/random-fill-sync/page.tsx (21:10) @ SyncIOComponent @@ -6636,8 +6640,8 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` } else { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", - "description": "Next.js encountered require('node:crypto').randomFillSync(...) without an explicit rendering intent.", + "code": "E1261", + "description": "Next.js encountered the unstable value require('node:crypto').randomFillSync(...) while prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/sync-io-node-crypto/random-fill-sync/page.tsx (21:3) @ SyncIOComponent @@ -6667,7 +6671,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` if (isTurbopack) { if (isDebugPrerender) { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-node-crypto/random-fill-sync": Next.js encountered \`require('node:crypto').randomFillSync(...)\` without an explicit rendering intent. + "Error: Route "/sync-io-node-crypto/random-fill-sync": Next.js encountered the unstable value \`require('node:crypto').randomFillSync(...)\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -6694,7 +6698,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` `) } else { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-node-crypto/random-fill-sync": Next.js encountered \`require('node:crypto').randomFillSync(...)\` without an explicit rendering intent. + "Error: Route "/sync-io-node-crypto/random-fill-sync": Next.js encountered the unstable value \`require('node:crypto').randomFillSync(...)\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -6722,7 +6726,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` } else { if (isDebugPrerender) { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-node-crypto/random-fill-sync": Next.js encountered \`require('node:crypto').randomFillSync(...)\` without an explicit rendering intent. + "Error: Route "/sync-io-node-crypto/random-fill-sync": Next.js encountered the unstable value \`require('node:crypto').randomFillSync(...)\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -6749,7 +6753,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` `) } else { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-node-crypto/random-fill-sync": Next.js encountered \`require('node:crypto').randomFillSync(...)\` without an explicit rendering intent. + "Error: Route "/sync-io-node-crypto/random-fill-sync": Next.js encountered the unstable value \`require('node:crypto').randomFillSync(...)\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -6782,8 +6786,8 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` if (isTurbopack) { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", - "description": "Next.js encountered require('node:crypto').randomInt(min, max) without an explicit rendering intent.", + "code": "E1261", + "description": "Next.js encountered the unstable value require('node:crypto').randomInt(min, max) while prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/sync-io-node-crypto/random-int-between/page.tsx (20:24) @ SyncIOComponent @@ -6798,8 +6802,8 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` } else { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", - "description": "Next.js encountered require('node:crypto').randomInt(min, max) without an explicit rendering intent.", + "code": "E1261", + "description": "Next.js encountered the unstable value require('node:crypto').randomInt(min, max) while prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/sync-io-node-crypto/random-int-between/page.tsx (20:17) @ SyncIOComponent @@ -6829,7 +6833,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` if (isTurbopack) { if (isDebugPrerender) { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-node-crypto/random-int-between": Next.js encountered \`require('node:crypto').randomInt(min, max)\` without an explicit rendering intent. + "Error: Route "/sync-io-node-crypto/random-int-between": Next.js encountered the unstable value \`require('node:crypto').randomInt(min, max)\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -6856,7 +6860,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` `) } else { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-node-crypto/random-int-between": Next.js encountered \`require('node:crypto').randomInt(min, max)\` without an explicit rendering intent. + "Error: Route "/sync-io-node-crypto/random-int-between": Next.js encountered the unstable value \`require('node:crypto').randomInt(min, max)\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -6884,7 +6888,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` } else { if (isDebugPrerender) { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-node-crypto/random-int-between": Next.js encountered \`require('node:crypto').randomInt(min, max)\` without an explicit rendering intent. + "Error: Route "/sync-io-node-crypto/random-int-between": Next.js encountered the unstable value \`require('node:crypto').randomInt(min, max)\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -6911,7 +6915,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` `) } else { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-node-crypto/random-int-between": Next.js encountered \`require('node:crypto').randomInt(min, max)\` without an explicit rendering intent. + "Error: Route "/sync-io-node-crypto/random-int-between": Next.js encountered the unstable value \`require('node:crypto').randomInt(min, max)\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -6944,8 +6948,8 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` if (isTurbopack) { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", - "description": "Next.js encountered require('node:crypto').randomInt(min, max) without an explicit rendering intent.", + "code": "E1261", + "description": "Next.js encountered the unstable value require('node:crypto').randomInt(min, max) while prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/sync-io-node-crypto/random-int-up-to/page.tsx (20:24) @ SyncIOComponent @@ -6960,8 +6964,8 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` } else { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", - "description": "Next.js encountered require('node:crypto').randomInt(min, max) without an explicit rendering intent.", + "code": "E1261", + "description": "Next.js encountered the unstable value require('node:crypto').randomInt(min, max) while prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/sync-io-node-crypto/random-int-up-to/page.tsx (20:17) @ SyncIOComponent @@ -6991,7 +6995,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` if (isTurbopack) { if (isDebugPrerender) { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-node-crypto/random-int-up-to": Next.js encountered \`require('node:crypto').randomInt(min, max)\` without an explicit rendering intent. + "Error: Route "/sync-io-node-crypto/random-int-up-to": Next.js encountered the unstable value \`require('node:crypto').randomInt(min, max)\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -7018,7 +7022,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` `) } else { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-node-crypto/random-int-up-to": Next.js encountered \`require('node:crypto').randomInt(min, max)\` without an explicit rendering intent. + "Error: Route "/sync-io-node-crypto/random-int-up-to": Next.js encountered the unstable value \`require('node:crypto').randomInt(min, max)\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -7046,7 +7050,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` } else { if (isDebugPrerender) { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-node-crypto/random-int-up-to": Next.js encountered \`require('node:crypto').randomInt(min, max)\` without an explicit rendering intent. + "Error: Route "/sync-io-node-crypto/random-int-up-to": Next.js encountered the unstable value \`require('node:crypto').randomInt(min, max)\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -7073,7 +7077,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` `) } else { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-node-crypto/random-int-up-to": Next.js encountered \`require('node:crypto').randomInt(min, max)\` without an explicit rendering intent. + "Error: Route "/sync-io-node-crypto/random-int-up-to": Next.js encountered the unstable value \`require('node:crypto').randomInt(min, max)\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -7106,8 +7110,8 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` if (isTurbopack) { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", - "description": "Next.js encountered require('node:crypto').randomUUID() without an explicit rendering intent.", + "code": "E1261", + "description": "Next.js encountered the unstable value require('node:crypto').randomUUID() while prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/sync-io-node-crypto/random-uuid/page.tsx (20:24) @ SyncIOComponent @@ -7122,8 +7126,8 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` } else { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", - "description": "Next.js encountered require('node:crypto').randomUUID() without an explicit rendering intent.", + "code": "E1261", + "description": "Next.js encountered the unstable value require('node:crypto').randomUUID() while prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/sync-io-node-crypto/random-uuid/page.tsx (20:17) @ SyncIOComponent @@ -7153,7 +7157,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` if (isTurbopack) { if (isDebugPrerender) { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-node-crypto/random-uuid": Next.js encountered \`require('node:crypto').randomUUID()\` without an explicit rendering intent. + "Error: Route "/sync-io-node-crypto/random-uuid": Next.js encountered the unstable value \`require('node:crypto').randomUUID()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -7180,7 +7184,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` `) } else { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-node-crypto/random-uuid": Next.js encountered \`require('node:crypto').randomUUID()\` without an explicit rendering intent. + "Error: Route "/sync-io-node-crypto/random-uuid": Next.js encountered the unstable value \`require('node:crypto').randomUUID()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -7208,7 +7212,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` } else { if (isDebugPrerender) { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-node-crypto/random-uuid": Next.js encountered \`require('node:crypto').randomUUID()\` without an explicit rendering intent. + "Error: Route "/sync-io-node-crypto/random-uuid": Next.js encountered the unstable value \`require('node:crypto').randomUUID()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -7235,7 +7239,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` `) } else { expect(output).toMatchInlineSnapshot(` - "Error: Route "/sync-io-node-crypto/random-uuid": Next.js encountered \`require('node:crypto').randomUUID()\` without an explicit rendering intent. + "Error: Route "/sync-io-node-crypto/random-uuid": Next.js encountered the unstable value \`require('node:crypto').randomUUID()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -7267,8 +7271,8 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1220", - "description": "Next.js encountered uncached data during the initial render.", + "code": "E1265", + "description": "Next.js encountered uncached data during prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/client-awaited-io/client.tsx (6:19) @ Client @@ -7297,14 +7301,14 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` if (isTurbopack) { if (isDebugPrerender) { expect(output).toMatchInlineSnapshot(` - "Error: Route "/client-awaited-io": Next.js encountered uncached or runtime data during the initial render. + "Error: Route "/client-awaited-io": Next.js encountered uncached or runtime data during prerendering. - \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience. Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -7325,14 +7329,14 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` `) } else { expect(output).toMatchInlineSnapshot(` - "Error: Route "/client-awaited-io": Next.js encountered uncached or runtime data during the initial render. + "Error: Route "/client-awaited-io": Next.js encountered uncached or runtime data during prerendering. - \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience. Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -7356,14 +7360,14 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` } else { if (isDebugPrerender) { expect(output).toMatchInlineSnapshot(` - "Error: Route "/client-awaited-io": Next.js encountered uncached or runtime data during the initial render. + "Error: Route "/client-awaited-io": Next.js encountered uncached or runtime data during prerendering. - \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience. Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -7384,14 +7388,14 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` `) } else { expect(output).toMatchInlineSnapshot(` - "Error: Route "/client-awaited-io": Next.js encountered uncached or runtime data during the initial render. + "Error: Route "/client-awaited-io": Next.js encountered uncached or runtime data during prerendering. - \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience. Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route diff --git a/test/e2e/app-dir/instant-validation-build/instant-validation-build.test.ts b/test/e2e/app-dir/instant-validation-build/instant-validation-build.test.ts index 13f2f996118a..fc61df0e0817 100644 --- a/test/e2e/app-dir/instant-validation-build/instant-validation-build.test.ts +++ b/test/e2e/app-dir/instant-validation-build/instant-validation-build.test.ts @@ -63,7 +63,7 @@ describe('instant-validation-build', () => { ) expect(extractBuildValidationError(result.cliOutput)) .toMatchInlineSnapshot(` - "Error: Route "/invalid-missing-suspense-around-runtime": Next.js encountered uncached data during the initial render or a navigation. + "Error: Route "/invalid-missing-suspense-around-runtime": Next.js encountered uncached data during prerendering or a navigation. \`fetch(...)\` or \`connection()\` accessed outside of \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. diff --git a/test/e2e/app-dir/instant-validation-causes/instant-validation-causes.test.ts b/test/e2e/app-dir/instant-validation-causes/instant-validation-causes.test.ts index 1a9eb517f614..bc799b5a4603 100644 --- a/test/e2e/app-dir/instant-validation-causes/instant-validation-causes.test.ts +++ b/test/e2e/app-dir/instant-validation-causes/instant-validation-causes.test.ts @@ -105,7 +105,7 @@ describe('instant validation causes', () => { ], }, ], - "code": "E1251", + "code": "E1271", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -136,7 +136,7 @@ describe('instant validation causes', () => { ], }, ], - "code": "E1251", + "code": "E1271", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -167,7 +167,7 @@ describe('instant validation causes', () => { ], }, ], - "code": "E1251", + "code": "E1271", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -201,7 +201,7 @@ describe('instant validation causes', () => { ], }, ], - "code": "E1251", + "code": "E1271", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", diff --git a/test/e2e/app-dir/instant-validation-level-error/instant-validation-level-error.test.ts b/test/e2e/app-dir/instant-validation-level-error/instant-validation-level-error.test.ts index ac346f83eb96..6e72ce24eb1f 100644 --- a/test/e2e/app-dir/instant-validation-level-error/instant-validation-level-error.test.ts +++ b/test/e2e/app-dir/instant-validation-level-error/instant-validation-level-error.test.ts @@ -60,7 +60,7 @@ describe('instant validation - level error', () => { const browser = await next.browser('/bare') await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1249", + "code": "E1264", "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -90,7 +90,7 @@ describe('instant validation - level error', () => { ], }, ], - "code": "E1249", + "code": "E1264", "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -120,7 +120,7 @@ describe('instant validation - level error', () => { ], }, ], - "code": "E1249", + "code": "E1264", "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -150,7 +150,7 @@ describe('instant validation - level error', () => { ], }, ], - "code": "E1249", + "code": "E1264", "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -177,7 +177,7 @@ describe('instant validation - level error', () => { const browser = await next.browser('/layered') await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1249", + "code": "E1264", "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -197,7 +197,7 @@ describe('instant validation - level error', () => { const result = await prerender('/bare') expect(extractBuildValidationError(result.cliOutput)) .toMatchInlineSnapshot(` - "Error: Route "/bare": Next.js encountered uncached data during the initial render or a navigation. + "Error: Route "/bare": Next.js encountered uncached data during prerendering or a navigation. \`fetch(...)\` or \`connection()\` accessed outside of \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. @@ -223,7 +223,7 @@ describe('instant validation - level error', () => { const result = await prerender('/explicit-error') expect(extractBuildValidationError(result.cliOutput)) .toMatchInlineSnapshot(` - "Error: Route "/explicit-error": Next.js encountered uncached data during the initial render or a navigation. + "Error: Route "/explicit-error": Next.js encountered uncached data during prerendering or a navigation. \`fetch(...)\` or \`connection()\` accessed outside of \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. @@ -249,7 +249,7 @@ describe('instant validation - level error', () => { const result = await prerender('/explicit-true') expect(extractBuildValidationError(result.cliOutput)) .toMatchInlineSnapshot(` - "Error: Route "/explicit-true": Next.js encountered uncached data during the initial render or a navigation. + "Error: Route "/explicit-true": Next.js encountered uncached data during prerendering or a navigation. \`fetch(...)\` or \`connection()\` accessed outside of \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. @@ -288,7 +288,7 @@ describe('instant validation - level error', () => { const result = await prerender('/layered') expect(extractBuildValidationError(result.cliOutput)) .toMatchInlineSnapshot(` - "Error: Route "/layered": Next.js encountered uncached data during the initial render or a navigation. + "Error: Route "/layered": Next.js encountered uncached data during prerendering or a navigation. \`fetch(...)\` or \`connection()\` accessed outside of \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. diff --git a/test/e2e/app-dir/instant-validation-level-manual-error/instant-validation-level-manual-error.test.ts b/test/e2e/app-dir/instant-validation-level-manual-error/instant-validation-level-manual-error.test.ts index 74f9e9fdb444..a24af1ba3c98 100644 --- a/test/e2e/app-dir/instant-validation-level-manual-error/instant-validation-level-manual-error.test.ts +++ b/test/e2e/app-dir/instant-validation-level-manual-error/instant-validation-level-manual-error.test.ts @@ -79,7 +79,7 @@ describe('instant validation - level manual-error', () => { ], }, ], - "code": "E1249", + "code": "E1264", "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -109,7 +109,7 @@ describe('instant validation - level manual-error', () => { ], }, ], - "code": "E1249", + "code": "E1264", "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -139,7 +139,7 @@ describe('instant validation - level manual-error', () => { ], }, ], - "code": "E1249", + "code": "E1264", "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -180,7 +180,7 @@ describe('instant validation - level manual-error', () => { const result = await prerender('/explicit-error') expect(extractBuildValidationError(result.cliOutput)) .toMatchInlineSnapshot(` - "Error: Route "/explicit-error": Next.js encountered uncached data during the initial render or a navigation. + "Error: Route "/explicit-error": Next.js encountered uncached data during prerendering or a navigation. \`fetch(...)\` or \`connection()\` accessed outside of \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. @@ -206,7 +206,7 @@ describe('instant validation - level manual-error', () => { const result = await prerender('/explicit-true') expect(extractBuildValidationError(result.cliOutput)) .toMatchInlineSnapshot(` - "Error: Route "/explicit-true": Next.js encountered uncached data during the initial render or a navigation. + "Error: Route "/explicit-true": Next.js encountered uncached data during prerendering or a navigation. \`fetch(...)\` or \`connection()\` accessed outside of \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. diff --git a/test/e2e/app-dir/instant-validation-level-manual-warning/instant-validation-level-manual-warning.test.ts b/test/e2e/app-dir/instant-validation-level-manual-warning/instant-validation-level-manual-warning.test.ts index 7ca9596bed3a..59452fc6446d 100644 --- a/test/e2e/app-dir/instant-validation-level-manual-warning/instant-validation-level-manual-warning.test.ts +++ b/test/e2e/app-dir/instant-validation-level-manual-warning/instant-validation-level-manual-warning.test.ts @@ -93,7 +93,7 @@ describe('instant validation - level manual-warning', () => { ], }, ], - "code": "E1249", + "code": "E1264", "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -125,7 +125,7 @@ describe('instant validation - level manual-warning', () => { ], }, ], - "code": "E1249", + "code": "E1264", "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -157,7 +157,7 @@ describe('instant validation - level manual-warning', () => { ], }, ], - "code": "E1249", + "code": "E1264", "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -192,7 +192,7 @@ describe('instant validation - level manual-warning', () => { const result = await prerender('/with-root-suspense/explicit-error') expect(extractBuildValidationError(result.cliOutput)) .toMatchInlineSnapshot(` - "Error: Route "/with-root-suspense/explicit-error": Next.js encountered uncached data during the initial render or a navigation. + "Error: Route "/with-root-suspense/explicit-error": Next.js encountered uncached data during prerendering or a navigation. \`fetch(...)\` or \`connection()\` accessed outside of \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. @@ -229,8 +229,8 @@ describe('instant validation - level manual-warning', () => { // did not run under 'manual-warning'. await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1220", - "description": "Next.js encountered uncached data during the initial render.", + "code": "E1265", + "description": "Next.js encountered uncached data during prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/without-root-suspense/bare/page.tsx (10:19) @ Page @@ -249,8 +249,8 @@ describe('instant validation - level manual-warning', () => { ) await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1220", - "description": "Next.js encountered uncached data during the initial render.", + "code": "E1265", + "description": "Next.js encountered uncached data during prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/without-root-suspense/explicit-error/page.tsx (11:19) @ Page @@ -269,8 +269,8 @@ describe('instant validation - level manual-warning', () => { ) await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1220", - "description": "Next.js encountered uncached data during the initial render.", + "code": "E1265", + "description": "Next.js encountered uncached data during prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/without-root-suspense/explicit-true/page.tsx (11:19) @ Page @@ -289,8 +289,8 @@ describe('instant validation - level manual-warning', () => { ) await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1220", - "description": "Next.js encountered uncached data during the initial render.", + "code": "E1265", + "description": "Next.js encountered uncached data during prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/without-root-suspense/explicit-warning/page.tsx (10:19) @ Page @@ -330,14 +330,14 @@ describe('instant validation - level manual-warning', () => { expectBuildFailedWithoutInstantValidation(result) expect(getPrerenderOutput(result.cliOutput, { isMinified: true })) .toMatchInlineSnapshot(` - "Error: Route "/without-root-suspense/bare": Next.js encountered uncached or runtime data during the initial render. + "Error: Route "/without-root-suspense/bare": Next.js encountered uncached or runtime data during prerendering. - \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience. Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -356,14 +356,14 @@ describe('instant validation - level manual-warning', () => { expectBuildFailedWithoutInstantValidation(result) expect(getPrerenderOutput(result.cliOutput, { isMinified: true })) .toMatchInlineSnapshot(` - "Error: Route "/without-root-suspense/explicit-true": Next.js encountered uncached or runtime data during the initial render. + "Error: Route "/without-root-suspense/explicit-true": Next.js encountered uncached or runtime data during prerendering. - \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience. Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -384,14 +384,14 @@ describe('instant validation - level manual-warning', () => { expectBuildFailedWithoutInstantValidation(result) expect(getPrerenderOutput(result.cliOutput, { isMinified: true })) .toMatchInlineSnapshot(` - "Error: Route "/without-root-suspense/explicit-warning": Next.js encountered uncached or runtime data during the initial render. + "Error: Route "/without-root-suspense/explicit-warning": Next.js encountered uncached or runtime data during prerendering. - \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience. Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -416,14 +416,14 @@ describe('instant validation - level manual-warning', () => { expectBuildFailedWithoutInstantValidation(result) expect(getPrerenderOutput(result.cliOutput, { isMinified: true })) .toMatchInlineSnapshot(` - "Error: Route "/without-root-suspense/explicit-error": Next.js encountered uncached or runtime data during the initial render. + "Error: Route "/without-root-suspense/explicit-error": Next.js encountered uncached or runtime data during prerendering. - \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience. Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route diff --git a/test/e2e/app-dir/instant-validation-level-warning/instant-validation-level-warning.test.ts b/test/e2e/app-dir/instant-validation-level-warning/instant-validation-level-warning.test.ts index d3db682bad6a..ced9212480dc 100644 --- a/test/e2e/app-dir/instant-validation-level-warning/instant-validation-level-warning.test.ts +++ b/test/e2e/app-dir/instant-validation-level-warning/instant-validation-level-warning.test.ts @@ -60,7 +60,7 @@ describe('instant validation - level warning', () => { const browser = await next.browser('/bare') await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1249", + "code": "E1264", "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -90,7 +90,7 @@ describe('instant validation - level warning', () => { ], }, ], - "code": "E1249", + "code": "E1264", "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -120,7 +120,7 @@ describe('instant validation - level warning', () => { ], }, ], - "code": "E1249", + "code": "E1264", "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -150,7 +150,7 @@ describe('instant validation - level warning', () => { ], }, ], - "code": "E1249", + "code": "E1264", "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -177,7 +177,7 @@ describe('instant validation - level warning', () => { const browser = await next.browser('/layered') await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1249", + "code": "E1264", "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -202,7 +202,7 @@ describe('instant validation - level warning', () => { const result = await prerender('/explicit-error') expect(extractBuildValidationError(result.cliOutput)) .toMatchInlineSnapshot(` - "Error: Route "/explicit-error": Next.js encountered uncached data during the initial render or a navigation. + "Error: Route "/explicit-error": Next.js encountered uncached data during prerendering or a navigation. \`fetch(...)\` or \`connection()\` accessed outside of \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. diff --git a/test/e2e/app-dir/instant-validation-static-shells/instant-validation-static-shells.test.ts b/test/e2e/app-dir/instant-validation-static-shells/instant-validation-static-shells.test.ts index 98eb6665f65f..058273c80438 100644 --- a/test/e2e/app-dir/instant-validation-static-shells/instant-validation-static-shells.test.ts +++ b/test/e2e/app-dir/instant-validation-static-shells/instant-validation-static-shells.test.ts @@ -45,8 +45,8 @@ describe('instant validation', () => { await browser.elementByCss('main') await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1220", - "description": "Next.js encountered uncached data during the initial render.", + "code": "E1265", + "description": "Next.js encountered uncached data during prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/blocking-page-below-static/page.tsx (6:19) @ Page @@ -69,7 +69,7 @@ describe('instant validation', () => { }) it('errors during build', () => { expect(didBuildError).toBe(true) - expect(next.cliOutput).toContain('during the initial render') + expect(next.cliOutput).toContain('during prerendering') }) } }) diff --git a/test/e2e/app-dir/instant-validation/instant-validation-parallel-slots.test.ts b/test/e2e/app-dir/instant-validation/instant-validation-parallel-slots.test.ts index cefa1e09041c..cc29f83ec034 100644 --- a/test/e2e/app-dir/instant-validation/instant-validation-parallel-slots.test.ts +++ b/test/e2e/app-dir/instant-validation/instant-validation-parallel-slots.test.ts @@ -124,7 +124,7 @@ describe('instant validation - parallel slot configs', () => { ], }, ], - "code": "E1251", + "code": "E1271", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -142,13 +142,13 @@ describe('instant validation - parallel slot configs', () => { ) expect(extractBuildValidationError(result.cliOutput)) .toMatchInlineSnapshot(` - "Error: Route "/suspense-in-root/parallel/slot-config-only": Next.js encountered runtime data during the initial render or a navigation. + "Error: Route "/suspense-in-root/parallel/slot-config-only": Next.js encountered runtime data during prerendering or a navigation. \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. Ways to fix this: - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -184,7 +184,7 @@ describe('instant validation - parallel slot configs', () => { ], }, ], - "code": "E1251", + "code": "E1271", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -202,13 +202,13 @@ describe('instant validation - parallel slot configs', () => { ) expect(extractBuildValidationError(result.cliOutput)) .toMatchInlineSnapshot(` - "Error: Route "/suspense-in-root/parallel/slot-layout-config": Next.js encountered runtime data during the initial render or a navigation. + "Error: Route "/suspense-in-root/parallel/slot-layout-config": Next.js encountered runtime data during prerendering or a navigation. \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. Ways to fix this: - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -244,7 +244,7 @@ describe('instant validation - parallel slot configs', () => { ], }, ], - "code": "E1251", + "code": "E1271", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -262,13 +262,13 @@ describe('instant validation - parallel slot configs', () => { ) expect(extractBuildValidationError(result.cliOutput)) .toMatchInlineSnapshot(` - "Error: Route "/suspense-in-root/parallel/slot-runtime-config": Next.js encountered runtime data during the initial render or a navigation. + "Error: Route "/suspense-in-root/parallel/slot-runtime-config": Next.js encountered runtime data during prerendering or a navigation. \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. Ways to fix this: - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -306,7 +306,7 @@ describe('instant validation - parallel slot configs', () => { ], }, ], - "code": "E1251", + "code": "E1271", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -324,13 +324,13 @@ describe('instant validation - parallel slot configs', () => { ) expect(extractBuildValidationError(result.cliOutput)) .toMatchInlineSnapshot(` - "Error: Route "/suspense-in-root/parallel/children-config-with-slot": Next.js encountered runtime data during the initial render or a navigation. + "Error: Route "/suspense-in-root/parallel/children-config-with-slot": Next.js encountered runtime data during prerendering or a navigation. \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. Ways to fix this: - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -368,7 +368,7 @@ describe('instant validation - parallel slot configs', () => { ], }, ], - "code": "E1251", + "code": "E1271", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -392,7 +392,7 @@ describe('instant validation - parallel slot configs', () => { ], }, ], - "code": "E1251", + "code": "E1271", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -411,13 +411,13 @@ describe('instant validation - parallel slot configs', () => { ) expect(extractBuildValidationError(result.cliOutput)) .toMatchInlineSnapshot(` - "Error: Route "/suspense-in-root/parallel/fork-layout-config-with-slot": Next.js encountered runtime data during the initial render or a navigation. + "Error: Route "/suspense-in-root/parallel/fork-layout-config-with-slot": Next.js encountered runtime data during prerendering or a navigation. \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. Ways to fix this: - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -425,13 +425,13 @@ describe('instant validation - parallel slot configs', () => { at body () at html () at a () - Error: Route "/suspense-in-root/parallel/fork-layout-config-with-slot": Next.js encountered runtime data during the initial render or a navigation. + Error: Route "/suspense-in-root/parallel/fork-layout-config-with-slot": Next.js encountered runtime data during prerendering or a navigation. \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. Ways to fix this: - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -535,7 +535,7 @@ describe('instant validation - parallel slot configs', () => { ], }, ], - "code": "E1251", + "code": "E1271", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -551,13 +551,13 @@ describe('instant validation - parallel slot configs', () => { const result = await prerender(href) expect(extractBuildValidationError(result.cliOutput)) .toMatchInlineSnapshot(` - "Error: Route "/suspense-in-root/parallel/conditional-breadcrumbs/show-both/blocked": Next.js encountered runtime data during the initial render or a navigation. + "Error: Route "/suspense-in-root/parallel/conditional-breadcrumbs/show-both/blocked": Next.js encountered runtime data during prerendering or a navigation. \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. Ways to fix this: - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -650,7 +650,7 @@ describe('instant validation - parallel slot configs', () => { ], }, ], - "code": "E1251", + "code": "E1271", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -666,13 +666,13 @@ describe('instant validation - parallel slot configs', () => { const result = await prerender(href) expect(extractBuildValidationError(result.cliOutput)) .toMatchInlineSnapshot(` - "Error: Route "/suspense-in-root/parallel/conditional-breadcrumbs/show-only-breadcrumbs/blocked": Next.js encountered runtime data during the initial render or a navigation. + "Error: Route "/suspense-in-root/parallel/conditional-breadcrumbs/show-only-breadcrumbs/blocked": Next.js encountered runtime data during prerendering or a navigation. \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. Ways to fix this: - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route diff --git a/test/e2e/app-dir/instant-validation/instant-validation.test.ts b/test/e2e/app-dir/instant-validation/instant-validation.test.ts index 9b3def2e15e1..ef3778dedb5b 100644 --- a/test/e2e/app-dir/instant-validation/instant-validation.test.ts +++ b/test/e2e/app-dir/instant-validation/instant-validation.test.ts @@ -180,7 +180,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1251", + "code": "E1271", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -198,13 +198,13 @@ describe('instant validation', () => { ) expect(extractBuildValidationError(result.cliOutput)) .toMatchInlineSnapshot(` - "Error: Route "/suspense-in-root/static/missing-suspense-around-runtime": Next.js encountered runtime data during the initial render or a navigation. + "Error: Route "/suspense-in-root/static/missing-suspense-around-runtime": Next.js encountered runtime data during prerendering or a navigation. \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. Ways to fix this: - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -240,7 +240,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1249", + "code": "E1264", "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -258,7 +258,7 @@ describe('instant validation', () => { ) expect(extractBuildValidationError(result.cliOutput)) .toMatchInlineSnapshot(` - "Error: Route "/suspense-in-root/static/missing-suspense-around-dynamic": Next.js encountered uncached data during the initial render or a navigation. + "Error: Route "/suspense-in-root/static/missing-suspense-around-dynamic": Next.js encountered uncached data during prerendering or a navigation. \`fetch(...)\` or \`connection()\` accessed outside of \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. @@ -300,7 +300,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1249", + "code": "E1264", "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -319,7 +319,7 @@ describe('instant validation', () => { ) expect(extractBuildValidationError(result.cliOutput)) .toMatchInlineSnapshot(` - "Error: Route "/suspense-in-root/runtime/missing-suspense-around-dynamic": Next.js encountered uncached data during the initial render or a navigation. + "Error: Route "/suspense-in-root/runtime/missing-suspense-around-dynamic": Next.js encountered uncached data during prerendering or a navigation. \`fetch(...)\` or \`connection()\` accessed outside of \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. @@ -363,7 +363,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1251", + "code": "E1271", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -381,13 +381,13 @@ describe('instant validation', () => { ) expect(extractBuildValidationError(result.cliOutput)) .toMatchInlineSnapshot(` - "Error: Route "/suspense-in-root/static/missing-suspense-around-dynamic-layout": Next.js encountered runtime data during the initial render or a navigation. + "Error: Route "/suspense-in-root/static/missing-suspense-around-dynamic-layout": Next.js encountered runtime data during prerendering or a navigation. \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. Ways to fix this: - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -423,7 +423,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1249", + "code": "E1264", "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -441,7 +441,7 @@ describe('instant validation', () => { ) expect(extractBuildValidationError(result.cliOutput)) .toMatchInlineSnapshot(` - "Error: Route "/suspense-in-root/runtime/missing-suspense-around-dynamic-layout": Next.js encountered uncached data during the initial render or a navigation. + "Error: Route "/suspense-in-root/runtime/missing-suspense-around-dynamic-layout": Next.js encountered uncached data during prerendering or a navigation. \`fetch(...)\` or \`connection()\` accessed outside of \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. @@ -486,7 +486,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1251", + "code": "E1271", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -534,7 +534,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1251", + "code": "E1271", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -552,13 +552,13 @@ describe('instant validation', () => { ) expect(extractBuildValidationError(result.cliOutput)) .toMatchInlineSnapshot(` - "Error: Route "/suspense-in-root/static/missing-suspense-around-search-params": Next.js encountered runtime data during the initial render or a navigation. + "Error: Route "/suspense-in-root/static/missing-suspense-around-search-params": Next.js encountered runtime data during prerendering or a navigation. \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. Ways to fix this: - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -629,7 +629,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1251", + "code": "E1271", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -647,13 +647,13 @@ describe('instant validation', () => { ) expect(extractBuildValidationError(result.cliOutput)) .toMatchInlineSnapshot(` - "Error: Route "/suspense-in-root/static/suspense-too-high": Next.js encountered runtime data during the initial render or a navigation. + "Error: Route "/suspense-in-root/static/suspense-too-high": Next.js encountered runtime data during prerendering or a navigation. \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. Ways to fix this: - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -692,7 +692,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1249", + "code": "E1264", "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -711,7 +711,7 @@ describe('instant validation', () => { ) expect(extractBuildValidationError(result.cliOutput)) .toMatchInlineSnapshot(` - "Error: Route "/suspense-in-root/runtime/suspense-too-high": Next.js encountered uncached data during the initial render or a navigation. + "Error: Route "/suspense-in-root/runtime/suspense-too-high": Next.js encountered uncached data during prerendering or a navigation. \`fetch(...)\` or \`connection()\` accessed outside of \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. @@ -744,8 +744,8 @@ describe('instant validation', () => { ) await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", - "description": "Next.js encountered Date.now() without an explicit rendering intent.", + "code": "E1261", + "description": "Next.js encountered the unstable value Date.now() while prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/suspense-in-root/runtime/invalid-sync-io/page.tsx (8:20) @ Page @@ -763,7 +763,7 @@ describe('instant validation', () => { ) expect(extractBuildValidationError(result.cliOutput)) .toMatchInlineSnapshot(` - "Error: Route "/suspense-in-root/runtime/invalid-sync-io": Next.js encountered \`Date.now()\` without an explicit rendering intent. + "Error: Route "/suspense-in-root/runtime/invalid-sync-io": Next.js encountered the unstable value \`Date.now()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -771,7 +771,7 @@ describe('instant validation', () => { - Render at request time by adding a dynamic data access (e.g. \`await connection()\`) before this call - Prerender and cache the value with \`"use cache"\` - Render the value on the client with \`"use client"\` - - Measure elapsed time with \`performance.now()\` instead of \`Date.now()\` + - If the value is for telemetry, use a timing API such as \`performance.now()\` Learn more: https://nextjs.org/docs/messages/next-prerender-runtime-current-time at a (app/suspense-in-root/runtime/invalid-sync-io/page.tsx:8:20) @@ -782,7 +782,7 @@ describe('instant validation', () => { 9 | return ( 10 |
11 |

This page uses sync IO after awaiting cookies(): {now}

- Error: Route "/suspense-in-root/runtime/invalid-sync-io": Next.js encountered \`Date.now()\` without an explicit rendering intent. + Error: Route "/suspense-in-root/runtime/invalid-sync-io": Next.js encountered the unstable value \`Date.now()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -790,7 +790,7 @@ describe('instant validation', () => { - Render at request time by adding a dynamic data access (e.g. \`await connection()\`) before this call - Prerender and cache the value with \`"use cache"\` - Render the value on the client with \`"use client"\` - - Measure elapsed time with \`performance.now()\` instead of \`Date.now()\` + - If the value is for telemetry, use a timing API such as \`performance.now()\` Learn more: https://nextjs.org/docs/messages/next-prerender-runtime-current-time at b (app/suspense-in-root/runtime/invalid-sync-io/page.tsx:8:20) @@ -822,8 +822,8 @@ describe('instant validation', () => { ) await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", - "description": "Next.js encountered Date.now() without an explicit rendering intent.", + "code": "E1261", + "description": "Next.js encountered the unstable value Date.now() while prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/suspense-in-root/runtime/invalid-sync-io-in-runtime-with-valid-static-parent/page.tsx (12:20) @ Page @@ -841,7 +841,7 @@ describe('instant validation', () => { ) expect(extractBuildValidationError(result.cliOutput)) .toMatchInlineSnapshot(` - "Error: Route "/suspense-in-root/runtime/invalid-sync-io-in-runtime-with-valid-static-parent": Next.js encountered \`Date.now()\` without an explicit rendering intent. + "Error: Route "/suspense-in-root/runtime/invalid-sync-io-in-runtime-with-valid-static-parent": Next.js encountered the unstable value \`Date.now()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -849,7 +849,7 @@ describe('instant validation', () => { - Render at request time by adding a dynamic data access (e.g. \`await connection()\`) before this call - Prerender and cache the value with \`"use cache"\` - Render the value on the client with \`"use client"\` - - Measure elapsed time with \`performance.now()\` instead of \`Date.now()\` + - If the value is for telemetry, use a timing API such as \`performance.now()\` Learn more: https://nextjs.org/docs/messages/next-prerender-runtime-current-time at a (app/suspense-in-root/runtime/invalid-sync-io-in-runtime-with-valid-static-parent/page.tsx:12:20) @@ -860,7 +860,7 @@ describe('instant validation', () => { 13 | return ( 14 |
15 |

Runtime page with sync IO after cookies: {now}

- Error: Route "/suspense-in-root/runtime/invalid-sync-io-in-runtime-with-valid-static-parent": Next.js encountered \`Date.now()\` without an explicit rendering intent. + Error: Route "/suspense-in-root/runtime/invalid-sync-io-in-runtime-with-valid-static-parent": Next.js encountered the unstable value \`Date.now()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -868,7 +868,7 @@ describe('instant validation', () => { - Render at request time by adding a dynamic data access (e.g. \`await connection()\`) before this call - Prerender and cache the value with \`"use cache"\` - Render the value on the client with \`"use client"\` - - Measure elapsed time with \`performance.now()\` instead of \`Date.now()\` + - If the value is for telemetry, use a timing API such as \`performance.now()\` Learn more: https://nextjs.org/docs/messages/next-prerender-runtime-current-time at b (app/suspense-in-root/runtime/invalid-sync-io-in-runtime-with-valid-static-parent/page.tsx:12:20) @@ -879,7 +879,7 @@ describe('instant validation', () => { 13 | return ( 14 |
15 |

Runtime page with sync IO after cookies: {now}

- Error: Route "/suspense-in-root/runtime/invalid-sync-io-in-runtime-with-valid-static-parent": Next.js encountered \`Date.now()\` without an explicit rendering intent. + Error: Route "/suspense-in-root/runtime/invalid-sync-io-in-runtime-with-valid-static-parent": Next.js encountered the unstable value \`Date.now()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -887,7 +887,7 @@ describe('instant validation', () => { - Render at request time by adding a dynamic data access (e.g. \`await connection()\`) before this call - Prerender and cache the value with \`"use cache"\` - Render the value on the client with \`"use client"\` - - Measure elapsed time with \`performance.now()\` instead of \`Date.now()\` + - If the value is for telemetry, use a timing API such as \`performance.now()\` Learn more: https://nextjs.org/docs/messages/next-prerender-runtime-current-time at c (app/suspense-in-root/runtime/invalid-sync-io-in-runtime-with-valid-static-parent/page.tsx:12:20) @@ -925,8 +925,8 @@ describe('instant validation', () => { ) await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", - "description": "Next.js encountered Date.now() without an explicit rendering intent.", + "code": "E1261", + "description": "Next.js encountered the unstable value Date.now() while prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/suspense-in-root/runtime/invalid-sync-io-after-cache-with-cookie-input/page.tsx (28:20) @ Page @@ -993,8 +993,8 @@ describe('instant validation', () => { ) await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", - "description": "Next.js encountered Date.now() without an explicit rendering intent.", + "code": "E1261", + "description": "Next.js encountered the unstable value Date.now() while prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/suspense-in-root/runtime/invalid-sync-io-in-generate-metadata/page.tsx (9:20) @ Module.generateMetadata @@ -1012,7 +1012,7 @@ describe('instant validation', () => { ) expect(extractBuildValidationError(result.cliOutput)) .toMatchInlineSnapshot(` - "Error: Route "/suspense-in-root/runtime/invalid-sync-io-in-generate-metadata": Next.js encountered \`Date.now()\` without an explicit rendering intent. + "Error: Route "/suspense-in-root/runtime/invalid-sync-io-in-generate-metadata": Next.js encountered the unstable value \`Date.now()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -1020,7 +1020,7 @@ describe('instant validation', () => { - Render at request time by adding a dynamic data access (e.g. \`await connection()\`) before this call - Prerender and cache the value with \`"use cache"\` - Render the value on the client with \`"use client"\` - - Measure elapsed time with \`performance.now()\` instead of \`Date.now()\` + - If the value is for telemetry, use a timing API such as \`performance.now()\` Learn more: https://nextjs.org/docs/messages/next-prerender-runtime-current-time at Module.e [as generateMetadata] (app/suspense-in-root/runtime/invalid-sync-io-in-generate-metadata/page.tsx:9:20) @@ -1031,7 +1031,7 @@ describe('instant validation', () => { 10 | return { 11 | title: \`Sync IO in metadata: \${now}\`, 12 | } - Error: Route "/suspense-in-root/runtime/invalid-sync-io-in-generate-metadata": Next.js encountered \`Date.now()\` without an explicit rendering intent. + Error: Route "/suspense-in-root/runtime/invalid-sync-io-in-generate-metadata": Next.js encountered the unstable value \`Date.now()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -1039,7 +1039,7 @@ describe('instant validation', () => { - Render at request time by adding a dynamic data access (e.g. \`await connection()\`) before this call - Prerender and cache the value with \`"use cache"\` - Render the value on the client with \`"use client"\` - - Measure elapsed time with \`performance.now()\` instead of \`Date.now()\` + - If the value is for telemetry, use a timing API such as \`performance.now()\` Learn more: https://nextjs.org/docs/messages/next-prerender-runtime-current-time at Module.e [as generateMetadata] (app/suspense-in-root/runtime/invalid-sync-io-in-generate-metadata/page.tsx:9:20) @@ -1089,8 +1089,8 @@ describe('instant validation', () => { ) await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", - "description": "Next.js encountered Date.now() without an explicit rendering intent.", + "code": "E1261", + "description": "Next.js encountered the unstable value Date.now() while prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/suspense-in-root/runtime/invalid-sync-io-in-layout-generate-metadata/layout.tsx (11:20) @ Module.generateMetadata @@ -1108,7 +1108,7 @@ describe('instant validation', () => { ) expect(extractBuildValidationError(result.cliOutput)) .toMatchInlineSnapshot(` - "Error: Route "/suspense-in-root/runtime/invalid-sync-io-in-layout-generate-metadata": Next.js encountered \`Date.now()\` without an explicit rendering intent. + "Error: Route "/suspense-in-root/runtime/invalid-sync-io-in-layout-generate-metadata": Next.js encountered the unstable value \`Date.now()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -1116,7 +1116,7 @@ describe('instant validation', () => { - Render at request time by adding a dynamic data access (e.g. \`await connection()\`) before this call - Prerender and cache the value with \`"use cache"\` - Render the value on the client with \`"use client"\` - - Measure elapsed time with \`performance.now()\` instead of \`Date.now()\` + - If the value is for telemetry, use a timing API such as \`performance.now()\` Learn more: https://nextjs.org/docs/messages/next-prerender-runtime-current-time at Module.d [as generateMetadata] (app/suspense-in-root/runtime/invalid-sync-io-in-layout-generate-metadata/layout.tsx:11:20) @@ -1127,7 +1127,7 @@ describe('instant validation', () => { 12 | return { 13 | title: \`Layout metadata with sync IO: \${now}\`, 14 | } - Error: Route "/suspense-in-root/runtime/invalid-sync-io-in-layout-generate-metadata": Next.js encountered \`Date.now()\` without an explicit rendering intent. + Error: Route "/suspense-in-root/runtime/invalid-sync-io-in-layout-generate-metadata": Next.js encountered the unstable value \`Date.now()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -1135,7 +1135,7 @@ describe('instant validation', () => { - Render at request time by adding a dynamic data access (e.g. \`await connection()\`) before this call - Prerender and cache the value with \`"use cache"\` - Render the value on the client with \`"use client"\` - - Measure elapsed time with \`performance.now()\` instead of \`Date.now()\` + - If the value is for telemetry, use a timing API such as \`performance.now()\` Learn more: https://nextjs.org/docs/messages/next-prerender-runtime-current-time at Module.d [as generateMetadata] (app/suspense-in-root/runtime/invalid-sync-io-in-layout-generate-metadata/layout.tsx:11:20) @@ -1146,7 +1146,7 @@ describe('instant validation', () => { 12 | return { 13 | title: \`Layout metadata with sync IO: \${now}\`, 14 | } - Error: Route "/suspense-in-root/runtime/invalid-sync-io-in-layout-generate-metadata": Next.js encountered \`Date.now()\` without an explicit rendering intent. + Error: Route "/suspense-in-root/runtime/invalid-sync-io-in-layout-generate-metadata": Next.js encountered the unstable value \`Date.now()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -1154,7 +1154,7 @@ describe('instant validation', () => { - Render at request time by adding a dynamic data access (e.g. \`await connection()\`) before this call - Prerender and cache the value with \`"use cache"\` - Render the value on the client with \`"use client"\` - - Measure elapsed time with \`performance.now()\` instead of \`Date.now()\` + - If the value is for telemetry, use a timing API such as \`performance.now()\` Learn more: https://nextjs.org/docs/messages/next-prerender-runtime-current-time at Module.d [as generateMetadata] (app/suspense-in-root/runtime/invalid-sync-io-in-layout-generate-metadata/layout.tsx:11:20) @@ -1231,7 +1231,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1249", + "code": "E1264", "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -1250,7 +1250,7 @@ describe('instant validation', () => { ) expect(extractBuildValidationError(result.cliOutput)) .toMatchInlineSnapshot(` - "Error: Route "/suspense-in-root/static/invalid-loading-above-route-group": Next.js encountered uncached data during the initial render or a navigation. + "Error: Route "/suspense-in-root/static/invalid-loading-above-route-group": Next.js encountered uncached data during prerendering or a navigation. \`fetch(...)\` or \`connection()\` accessed outside of \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. @@ -1295,7 +1295,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1249", + "code": "E1264", "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -1314,7 +1314,7 @@ describe('instant validation', () => { ) expect(extractBuildValidationError(result.cliOutput)) .toMatchInlineSnapshot(` - "Error: Route "/suspense-in-root/static/invalid-dynamic-layout-with-loading": Next.js encountered uncached data during the initial render or a navigation. + "Error: Route "/suspense-in-root/static/invalid-dynamic-layout-with-loading": Next.js encountered uncached data during prerendering or a navigation. \`fetch(...)\` or \`connection()\` accessed outside of \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. @@ -1372,7 +1372,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1251", + "code": "E1271", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -1390,13 +1390,13 @@ describe('instant validation', () => { ) expect(extractBuildValidationError(result.cliOutput)) .toMatchInlineSnapshot(` - "Error: Route "/suspense-in-root/static/blocking-layout/missing-suspense-around-dynamic": Next.js encountered runtime data during the initial render or a navigation. + "Error: Route "/suspense-in-root/static/blocking-layout/missing-suspense-around-dynamic": Next.js encountered runtime data during prerendering or a navigation. \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. Ways to fix this: - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -1460,7 +1460,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1251", + "code": "E1271", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -1478,13 +1478,13 @@ describe('instant validation', () => { ) expect(extractBuildValidationError(result.cliOutput)) .toMatchInlineSnapshot(` - "Error: Route "/suspense-in-root/static/invalid-blocking-inside-static": Next.js encountered runtime data during the initial render or a navigation. + "Error: Route "/suspense-in-root/static/invalid-blocking-inside-static": Next.js encountered runtime data during prerendering or a navigation. \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. Ways to fix this: - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -1521,7 +1521,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1249", + "code": "E1264", "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -1539,7 +1539,7 @@ describe('instant validation', () => { ) expect(extractBuildValidationError(result.cliOutput)) .toMatchInlineSnapshot(` - "Error: Route "/suspense-in-root/runtime/invalid-blocking-inside-runtime": Next.js encountered uncached data during the initial render or a navigation. + "Error: Route "/suspense-in-root/runtime/invalid-blocking-inside-runtime": Next.js encountered uncached data during prerendering or a navigation. \`fetch(...)\` or \`connection()\` accessed outside of \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. @@ -1585,7 +1585,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1251", + "code": "E1271", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -1603,13 +1603,13 @@ describe('instant validation', () => { ) expect(extractBuildValidationError(result.cliOutput)) .toMatchInlineSnapshot(` - "Error: Route "/suspense-in-root/static/missing-suspense-in-parallel-route": Next.js encountered runtime data during the initial render or a navigation. + "Error: Route "/suspense-in-root/static/missing-suspense-in-parallel-route": Next.js encountered runtime data during prerendering or a navigation. \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. Ways to fix this: - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -1647,7 +1647,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1251", + "code": "E1271", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -1665,13 +1665,13 @@ describe('instant validation', () => { ) expect(extractBuildValidationError(result.cliOutput)) .toMatchInlineSnapshot(` - "Error: Route "/suspense-in-root/static/missing-suspense-in-parallel-route/foo": Next.js encountered runtime data during the initial render or a navigation. + "Error: Route "/suspense-in-root/static/missing-suspense-in-parallel-route/foo": Next.js encountered runtime data during prerendering or a navigation. \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. Ways to fix this: - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -1709,7 +1709,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1251", + "code": "E1271", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -1727,13 +1727,13 @@ describe('instant validation', () => { ) expect(extractBuildValidationError(result.cliOutput)) .toMatchInlineSnapshot(` - "Error: Route "/suspense-in-root/static/missing-suspense-in-parallel-route/bar": Next.js encountered runtime data during the initial render or a navigation. + "Error: Route "/suspense-in-root/static/missing-suspense-in-parallel-route/bar": Next.js encountered runtime data during prerendering or a navigation. \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. Ways to fix this: - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -2362,7 +2362,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1208", + "code": "E1252", "description": "Next.js encountered runtime data in generateViewport().", "environmentLabel": "Server", "label": "Instant", @@ -2386,7 +2386,6 @@ describe('instant validation', () => { Ways to fix this: - Use a static viewport export instead of \`generateViewport()\` - - Wrap your document \`\` in \`\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/next-prerender-dynamic-viewport @@ -2422,7 +2421,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1210", + "code": "E1255", "description": "Next.js encountered uncached data in generateViewport().", "environmentLabel": "Server", "label": "Instant", @@ -2446,7 +2445,6 @@ describe('instant validation', () => { Ways to fix this: - Cache the viewport data with \`"use cache"\` in \`generateViewport()\` - - Wrap your document \`\` in \`\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/next-prerender-dynamic-viewport @@ -2520,7 +2518,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1210", + "code": "E1255", "description": "Next.js encountered uncached data in generateViewport().", "environmentLabel": "Server", "label": "Instant", @@ -2544,7 +2542,6 @@ describe('instant validation', () => { Ways to fix this: - Cache the viewport data with \`"use cache"\` in \`generateViewport()\` - - Wrap your document \`\` in \`\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/next-prerender-dynamic-viewport @@ -2580,7 +2577,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1251", + "code": "E1271", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -2598,13 +2595,13 @@ describe('instant validation', () => { ) expect(extractBuildValidationError(result.cliOutput)) .toMatchInlineSnapshot(` - "Error: Route "/suspense-in-root/static/route-group-config-only": Next.js encountered runtime data during the initial render or a navigation. + "Error: Route "/suspense-in-root/static/route-group-config-only": Next.js encountered runtime data during prerendering or a navigation. \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. Ways to fix this: - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -2641,7 +2638,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1251", + "code": "E1271", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -2659,13 +2656,13 @@ describe('instant validation', () => { ) expect(extractBuildValidationError(result.cliOutput)) .toMatchInlineSnapshot(` - "Error: Route "/suspense-in-root/static/route-group-config-and-segment-config": Next.js encountered runtime data during the initial render or a navigation. + "Error: Route "/suspense-in-root/static/route-group-config-and-segment-config": Next.js encountered runtime data during prerendering or a navigation. \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. Ways to fix this: - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -2703,7 +2700,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1251", + "code": "E1271", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -2721,13 +2718,13 @@ describe('instant validation', () => { ) expect(extractBuildValidationError(result.cliOutput)) .toMatchInlineSnapshot(` - "Error: Route "/suspense-in-root/static/route-group-segment-config-only": Next.js encountered runtime data during the initial render or a navigation. + "Error: Route "/suspense-in-root/static/route-group-segment-config-only": Next.js encountered runtime data during prerendering or a navigation. \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. Ways to fix this: - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -2765,7 +2762,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1251", + "code": "E1271", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -2783,13 +2780,13 @@ describe('instant validation', () => { ) expect(extractBuildValidationError(result.cliOutput)) .toMatchInlineSnapshot(` - "Error: Route "/suspense-in-root/static/route-group-config-with-deeper-segment/inner": Next.js encountered runtime data during the initial render or a navigation. + "Error: Route "/suspense-in-root/static/route-group-config-with-deeper-segment/inner": Next.js encountered runtime data during prerendering or a navigation. \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. Ways to fix this: - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -2827,7 +2824,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1251", + "code": "E1271", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -2845,13 +2842,13 @@ describe('instant validation', () => { ) expect(extractBuildValidationError(result.cliOutput)) .toMatchInlineSnapshot(` - "Error: Route "/suspense-in-root/static/route-group-deeper-segment-config/inner": Next.js encountered runtime data during the initial render or a navigation. + "Error: Route "/suspense-in-root/static/route-group-deeper-segment-config/inner": Next.js encountered runtime data during prerendering or a navigation. \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. Ways to fix this: - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -2896,7 +2893,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1251", + "code": "E1271", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -2914,13 +2911,13 @@ describe('instant validation', () => { ) expect(extractBuildValidationError(result.cliOutput)) .toMatchInlineSnapshot(` - "Error: Route "/suspense-in-root/static/route-group-shared-boundary": Next.js encountered runtime data during the initial render or a navigation. + "Error: Route "/suspense-in-root/static/route-group-shared-boundary": Next.js encountered runtime data during prerendering or a navigation. \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. Ways to fix this: - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -2972,7 +2969,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1251", + "code": "E1271", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -2990,13 +2987,13 @@ describe('instant validation', () => { ) expect(extractBuildValidationError(result.cliOutput)) .toMatchInlineSnapshot(` - "Error: Route "/suspense-in-root/static/parallel-group-depths-deep-slot-hole": Next.js encountered runtime data during the initial render or a navigation. + "Error: Route "/suspense-in-root/static/parallel-group-depths-deep-slot-hole": Next.js encountered runtime data during prerendering or a navigation. \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. Ways to fix this: - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -3042,7 +3039,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1251", + "code": "E1271", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -3060,13 +3057,13 @@ describe('instant validation', () => { ) expect(extractBuildValidationError(result.cliOutput)) .toMatchInlineSnapshot(` - "Error: Route "/suspense-in-root/static/parallel-group-depths-shallow-slot-hole": Next.js encountered runtime data during the initial render or a navigation. + "Error: Route "/suspense-in-root/static/parallel-group-depths-shallow-slot-hole": Next.js encountered runtime data during prerendering or a navigation. \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. Ways to fix this: - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -3113,7 +3110,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1251", + "code": "E1271", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -3131,13 +3128,13 @@ describe('instant validation', () => { ) expect(extractBuildValidationError(result.cliOutput)) .toMatchInlineSnapshot(` - "Error: Route "/suspense-in-root/runtime/static-layout-above-runtime-config/inner": Next.js encountered runtime data during the initial render or a navigation. + "Error: Route "/suspense-in-root/runtime/static-layout-above-runtime-config/inner": Next.js encountered runtime data during prerendering or a navigation. \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. Ways to fix this: - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -3181,7 +3178,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1251", + "code": "E1271", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -3232,7 +3229,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1251", + "code": "E1271", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -3250,13 +3247,13 @@ describe('instant validation', () => { ) expect(extractBuildValidationError(result.cliOutput)) .toMatchInlineSnapshot(` - "Error: Route "/suspense-in-root/static/config-depth-preference-slot-wins/deeper/[...rest]": Next.js encountered runtime data during the initial render or a navigation. + "Error: Route "/suspense-in-root/static/config-depth-preference-slot-wins/deeper/[...rest]": Next.js encountered runtime data during prerendering or a navigation. \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. Ways to fix this: - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -3296,7 +3293,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1251", + "code": "E1271", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -3314,13 +3311,13 @@ describe('instant validation', () => { ) expect(extractBuildValidationError(result.cliOutput)) .toMatchInlineSnapshot(` - "Error: Route "/suspense-in-root/static/config-children-preferred": Next.js encountered runtime data during the initial render or a navigation. + "Error: Route "/suspense-in-root/static/config-children-preferred": Next.js encountered runtime data during prerendering or a navigation. \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. Ways to fix this: - Provide a placeholder with \`\` around the data access - - Use \`generateStaticParams\` to make route params static + - If the runtime data is \`params\` and they're known, prerender them with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -3361,7 +3358,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1251", + "code": "E1271", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -3646,7 +3643,7 @@ describe('instant validation', () => { ) expect(extractBuildValidationError(result.cliOutput)) .toMatchInlineSnapshot(` - "Error: Route "/suspense-in-root/disable-validation/disable-dev": Next.js encountered uncached data during the initial render or a navigation. + "Error: Route "/suspense-in-root/disable-validation/disable-dev": Next.js encountered uncached data during prerendering or a navigation. \`fetch(...)\` or \`connection()\` accessed outside of \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. @@ -3688,7 +3685,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1249", + "code": "E1264", "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", diff --git a/test/production/app-dir/build-output-prerender/build-output-prerender.test.ts b/test/production/app-dir/build-output-prerender/build-output-prerender.test.ts index f7266425ec67..ebba50bd44cf 100644 --- a/test/production/app-dir/build-output-prerender/build-output-prerender.test.ts +++ b/test/production/app-dir/build-output-prerender/build-output-prerender.test.ts @@ -71,13 +71,14 @@ describe('build-output-prerender', () => { if (isTurbopack) { // TODO(veil): Why is the location incomplete unless we enable --no-mangling? expect(getPrerenderOutput(next.cliOutput)).toMatchInlineSnapshot(` - "Error: Route "/client": Next.js encountered \`new Date()\` in a Client Component. + "Error: Route "/client": Next.js encountered the unstable value \`new Date()\` in a Client Component. - This value would be evaluated during the prerender and fixed at build time, instead of recomputed on each visit. + This value would be evaluated during the prerender, instead of recomputed on each visit. Ways to fix this: - Wrap the Client Component in \`\` - Move the read into a \`useEffect\` or event handler + - If the value is for telemetry, use a timing API such as \`performance.now()\` Learn more: https://nextjs.org/docs/messages/next-prerender-current-time-client at (app/client/page.tsx:4:28) @@ -95,13 +96,14 @@ describe('build-output-prerender', () => { `) } else { expect(getPrerenderOutput(next.cliOutput)).toMatchInlineSnapshot(` - "Error: Route "/client": Next.js encountered \`new Date()\` in a Client Component. + "Error: Route "/client": Next.js encountered the unstable value \`new Date()\` in a Client Component. - This value would be evaluated during the prerender and fixed at build time, instead of recomputed on each visit. + This value would be evaluated during the prerender, instead of recomputed on each visit. Ways to fix this: - Wrap the Client Component in \`\` - Move the read into a \`useEffect\` or event handler + - If the value is for telemetry, use a timing API such as \`performance.now()\` Learn more: https://nextjs.org/docs/messages/next-prerender-current-time-client at x () @@ -210,13 +212,14 @@ describe('build-output-prerender', () => { it('shows all prerender errors with readable stacks and code frames', async () => { if (isTurbopack) { expect(getPrerenderOutput(next.cliOutput)).toMatchInlineSnapshot(` - "Error: Route "/client": Next.js encountered \`new Date()\` in a Client Component. + "Error: Route "/client": Next.js encountered the unstable value \`new Date()\` in a Client Component. - This value would be evaluated during the prerender and fixed at build time, instead of recomputed on each visit. + This value would be evaluated during the prerender, instead of recomputed on each visit. Ways to fix this: - Wrap the Client Component in \`\` - Move the read into a \`useEffect\` or event handler + - If the value is for telemetry, use a timing API such as \`performance.now()\` Learn more: https://nextjs.org/docs/messages/next-prerender-current-time-client at Page (app/client/page.tsx:4:28) @@ -228,7 +231,7 @@ describe('build-output-prerender', () => { 6 | To debug the issue, start the app in development mode by running \`next dev\`, then open "/client" in your browser to investigate the error. Error occurred prerendering page "/client". Read more: https://nextjs.org/docs/messages/prerender-error - Error: Route "/server": Next.js encountered \`Math.random()\` without an explicit rendering intent. + Error: Route "/server": Next.js encountered the unstable value \`Math.random()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -256,13 +259,14 @@ describe('build-output-prerender', () => { } else { // TODO(veil): Bundler protocols should not appear in stackframes. expect(getPrerenderOutput(next.cliOutput)).toMatchInlineSnapshot(` - "Error: Route "/client": Next.js encountered \`new Date()\` in a Client Component. + "Error: Route "/client": Next.js encountered the unstable value \`new Date()\` in a Client Component. - This value would be evaluated during the prerender and fixed at build time, instead of recomputed on each visit. + This value would be evaluated during the prerender, instead of recomputed on each visit. Ways to fix this: - Wrap the Client Component in \`\` - Move the read into a \`useEffect\` or event handler + - If the value is for telemetry, use a timing API such as \`performance.now()\` Learn more: https://nextjs.org/docs/messages/next-prerender-current-time-client at Page (webpack:///app/client/page.tsx:4:28) @@ -275,7 +279,7 @@ describe('build-output-prerender', () => { 6 | To debug the issue, start the app in development mode by running \`next dev\`, then open "/client" in your browser to investigate the error. Error occurred prerendering page "/client". Read more: https://nextjs.org/docs/messages/prerender-error - Error: Route "/server": Next.js encountered \`Math.random()\` without an explicit rendering intent. + Error: Route "/server": Next.js encountered the unstable value \`Math.random()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later.