From 0f0aa80bfa8dc1b1e421dceff9a9f3a1a7502822 Mon Sep 17 00:00:00 2001 From: Aurora Scharff Date: Thu, 14 May 2026 11:08:01 +0200 Subject: [PATCH 01/34] Clear instant validation errors on route change + nav body variants Adds two pieces of framework correctness for `unstable_instant` validation: 1. **Navigation body factories** in `blocking-route-messages.ts`: - `createRuntimeBodyErrorInNavigation` (E1247) - `createDynamicBodyErrorInNavigation` (E1246) Wired into `trackDynamicHoleInNavigation` so the in-navigation case emits its own message ("accessed under ``" + nav-aware "Ways to fix") instead of reusing the initial-render copy ("accessed outside of ``"). Phase-neutral phrasing ("during the initial render or a navigation") accommodates the path firing from either prerender or client-nav validation. 2. **Clear-on-nav reducer** in the dev overlay: - `ACTION_INSTANT_ERRORS_CLEAR` reducer case in `shared.ts`. - `useClearInstantErrorsOnNav` hook in `dev-overlay.tsx` watches `usePathname()` and dispatches when the route changes. Only errors fired during a client navigation are eligible to clear: `*InNavigation` factories carry an `__nextInstantNav` marker, and wrapper headlines (E1082 / E1112 / E1113 / E1118) are detected via the stable "Could not validate `unstable_instant`" substring. Initial-render / SSR errors lack both signals and persist, so a page that fails to prerender stays in the overlay until the source is fixed. Co-authored-by: Cursor --- packages/next/errors.json | 4 +- .../next-devtools/dev-overlay/dev-overlay.tsx | 21 ++++++++++- .../src/next-devtools/dev-overlay/shared.ts | 37 +++++++++++++++++++ .../app-render/blocking-route-messages.ts | 33 +++++++++++++++++ .../server/app-render/dynamic-rendering.ts | 6 ++- 5 files changed, 97 insertions(+), 4 deletions(-) diff --git a/packages/next/errors.json b/packages/next/errors.json index e40b508787a3..cbd9819ff37e 100644 --- a/packages/next/errors.json +++ b/packages/next/errors.json @@ -1243,5 +1243,7 @@ "1242": "Route \"%s\": Next.js encountered %s without an explicit rendering intent.\\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", "1243": "This \"use cache\" has a dynamic cache life that was propagated to its parent.", "1244": "A \"use cache\" with short \\`expire\\` (under 5 minutes) is nested inside another \"use cache\" that has no explicit \\`cacheLife\\`, which is not allowed during prerendering. Add \\`cacheLife()\\` to the outer \"use cache\" to choose whether it should be prerendered (with longer \\`expire\\`) or remain dynamic (with short \\`expire\\`). Read more: https://nextjs.org/docs/messages/nested-use-cache-no-explicit-cachelife", - "1245": "A \"use cache\" with zero \\`revalidate\\` is nested inside another \"use cache\" that has no explicit \\`cacheLife\\`, which is not allowed during prerendering. Add \\`cacheLife()\\` to the outer \"use cache\" to choose whether it should be prerendered (with non-zero \\`revalidate\\`) or remain dynamic (with zero \\`revalidate\\`). Read more: https://nextjs.org/docs/messages/nested-use-cache-no-explicit-cachelife" + "1245": "A \"use cache\" with zero \\`revalidate\\` is nested inside another \"use cache\" that has no explicit \\`cacheLife\\`, which is not allowed during prerendering. Add \\`cacheLife()\\` to the outer \"use cache\" to choose whether it should be prerendered (with non-zero \\`revalidate\\`) or remain dynamic (with zero \\`revalidate\\`). Read more: https://nextjs.org/docs/messages/nested-use-cache-no-explicit-cachelife", + "1246": "Route \"%s\": Next.js encountered uncached data during the initial render or a navigation.\\n\\n\\`fetch(...)\\` or \\`connection()\\` accessed under \\`\\` 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", + "1247": "Route \"%s\": Next.js encountered runtime data during the initial render or a navigation.\\n\\n\\`cookies()\\`, \\`headers()\\`, \\`params\\`, or \\`searchParams\\` accessed under \\`\\` 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" } diff --git a/packages/next/src/next-devtools/dev-overlay/dev-overlay.tsx b/packages/next/src/next-devtools/dev-overlay/dev-overlay.tsx index f0ac1350ffd8..9dab2d5f3d42 100644 --- a/packages/next/src/next-devtools/dev-overlay/dev-overlay.tsx +++ b/packages/next/src/next-devtools/dev-overlay/dev-overlay.tsx @@ -1,4 +1,5 @@ -import { createContext, useContext, useRef, useState } from 'react' +import { createContext, useContext, useEffect, useRef, useState } from 'react' +import { usePathname } from '../../client/components/navigation' import { ShadowPortal } from './components/shadow-portal' import { ComponentStyles } from './styles/component-styles' import { ErrorOverlay } from './components/errors/error-overlay/error-overlay' @@ -9,6 +10,7 @@ import { DevToolsIndicator } from './components/devtools-indicator/devtools-indi import { PanelRouter } from './menu/panel-router' import { PanelRouterContext, type PanelStateKind } from './menu/context' import { useDevOverlayContext } from '../dev-overlay.browser' +import { ACTION_INSTANT_ERRORS_CLEAR, type DispatcherEvent } from './shared' export const RenderErrorContext = createContext<{ runtimeErrors: ReadyRuntimeError[] @@ -17,6 +19,21 @@ export const RenderErrorContext = createContext<{ export const useRenderErrorContext = () => useContext(RenderErrorContext) +function useClearInstantErrorsOnNav( + dispatch: (action: DispatcherEvent) => void +) { + const pathname = usePathname() + const previousPathnameRef = useRef(pathname) + useEffect(() => { + if (previousPathnameRef.current === pathname) return + previousPathnameRef.current = pathname + dispatch({ + type: ACTION_INSTANT_ERRORS_CLEAR, + currentPath: pathname ?? '', + }) + }, [pathname, dispatch]) +} + export function DevOverlay() { const [selectedIndex, setSelectedIndex] = useState(-1) const { state, dispatch, getSquashedHydrationErrorDetails } = @@ -25,6 +42,8 @@ export function DevOverlay() { state.instantNavs ? 'instant-navs' : null ) + useClearInstantErrorsOnNav(dispatch) + const triggerRef = useRef(null) return ( diff --git a/packages/next/src/next-devtools/dev-overlay/shared.ts b/packages/next/src/next-devtools/dev-overlay/shared.ts index 1d726d9c6041..92e42e210a70 100644 --- a/packages/next/src/next-devtools/dev-overlay/shared.ts +++ b/packages/next/src/next-devtools/dev-overlay/shared.ts @@ -107,6 +107,7 @@ export const ACTION_DEVTOOLS_SCALE = 'devtools-scale' export const ACTION_DEVTOOLS_CONFIG = 'devtools-config' export const ACTION_INSTANT_NAVS_TOGGLE = 'instant-navs-toggle' export const ACTION_INSTANT_NAVS_RESET = 'instant-navs-reset' +export const ACTION_INSTANT_ERRORS_CLEAR = 'instant-errors-clear' export const STORAGE_KEY_PANEL_POSITION_PREFIX = '__nextjs-dev-tools-panel-position' @@ -231,6 +232,11 @@ interface InstantNavResetAction { type: typeof ACTION_INSTANT_NAVS_RESET } +interface InstantErrorsClearAction { + type: typeof ACTION_INSTANT_ERRORS_CLEAR + currentPath: string +} + export type DispatcherEvent = | BuildOkAction | BuildErrorAction @@ -258,6 +264,7 @@ export type DispatcherEvent = | DevToolsConfigAction | CacheOnlyToggleAction | InstantNavResetAction + | InstantErrorsClearAction const REACT_ERROR_STACK_BOTTOM_FRAME_REGEX = // 1st group: new frame + v8 @@ -274,6 +281,25 @@ function getStackIgnoringStrictMode(stack: string | undefined) { return stack?.split(REACT_ERROR_STACK_BOTTOM_FRAME_REGEX)[0] } +// Errors stamped by the `*InNavigation` factories or wrappers from +// `dynamic-rendering.ts` navigation paths — both clear on nav. Initial-render +// errors lack both signals and persist. +function getInstantErrorRoute(error: unknown): string | null { + if (!error || typeof error !== 'object') return null + const message = (error as Error).message + if (typeof message !== 'string') return null + + const isNavigationFactory = + (error as { __nextInstantNav?: unknown }).__nextInstantNav === true + const isNavigationWrapper = message.includes( + 'Could not validate `unstable_instant`' + ) + if (!isNavigationFactory && !isNavigationWrapper) return null + + const match = /^Route "([^"]+)":/.exec(message) + return match ? match[1] : null +} + const shouldDisableDevIndicator = process.env.__NEXT_DEV_INDICATOR?.toString() === 'false' @@ -539,6 +565,17 @@ export function useErrorOverlayReducer( case ACTION_INSTANT_NAVS_RESET: { return { ...state, instantNavs: false } } + case ACTION_INSTANT_ERRORS_CLEAR: { + const remaining = state.errors.filter((event) => { + const route = getInstantErrorRoute(event.error) + if (route === null) return true + return route === action.currentPath + }) + if (remaining.length === state.errors.length) { + return state + } + return { ...state, errors: remaining } + } default: { return state } 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 cb1de77cb370..05ad65912e81 100644 --- a/packages/next/src/server/app-render/blocking-route-messages.ts +++ b/packages/next/src/server/app-render/blocking-route-messages.ts @@ -22,6 +22,39 @@ export function createDynamicBodyError(route: string): Error { ) } +function markAsInstantNavigationError(error: Error): Error { + ;(error as { __nextInstantNav?: boolean }).__nextInstantNav = true + return error +} + +export function createRuntimeBodyErrorInNavigation(route: string): Error { + return markAsInstantNavigationError( + new Error( + `Route "${route}": Next.js encountered runtime data during the initial render or a navigation.\n\n` + + `\`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` 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` + + ` - 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\n` + + `Learn more: https://nextjs.org/docs/messages/blocking-route` + ) + ) +} + +export function createDynamicBodyErrorInNavigation(route: string): Error { + return markAsInstantNavigationError( + new Error( + `Route "${route}": Next.js encountered uncached data during the initial render or a navigation.\n\n` + + `\`fetch(...)\` or \`connection()\` accessed under \`\` 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` + + ` - Provide a placeholder with \`\` around the data access\n` + + ` - Set \`export const instant = false\` to allow a blocking route\n\n` + + `Learn more: https://nextjs.org/docs/messages/blocking-route` + ) + ) +} + /** * NOTE: Prefer `createRuntimeBodyError` or `createDynamicBodyError`. * Only use this in situations like build-time static validation, where diff --git a/packages/next/src/server/app-render/dynamic-rendering.ts b/packages/next/src/server/app-render/dynamic-rendering.ts index 93a3b649e01c..ece02a9c8a9c 100644 --- a/packages/next/src/server/app-render/dynamic-rendering.ts +++ b/packages/next/src/server/app-render/dynamic-rendering.ts @@ -50,6 +50,8 @@ import { BailoutToCSRError } from '../../shared/lib/lazy-dynamic/bailout-to-csr' import { createRuntimeBodyError, createDynamicBodyError, + createRuntimeBodyErrorInNavigation, + createDynamicBodyErrorInNavigation, createDynamicOrRuntimeBodyError, createRuntimeMetadataError, createDynamicMetadataError, @@ -1026,8 +1028,8 @@ export function trackDynamicHoleInNavigation( const error = addErrorContext( kind === DynamicHoleKind.Runtime - ? createRuntimeBodyError(workStore.route) - : createDynamicBodyError(workStore.route), + ? createRuntimeBodyErrorInNavigation(workStore.route) + : createDynamicBodyErrorInNavigation(workStore.route), componentStack, effectiveCreateInstantStack ) From 68a47a26c42fa1e27eb23df678ffff35237cf64d Mon Sep 17 00:00:00 2001 From: Aurora Scharff Date: Thu, 14 May 2026 11:20:01 +0200 Subject: [PATCH 02/34] Show navigation-specific headline + explanation in dev overlay MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reads the `__nextInstantNav` marker from the error to pick the right overlay copy for the blocking-route family: - Headline: "Next.js encountered runtime/uncached data during a navigation." (in-nav) vs. "during the initial render." (initial). - Explanation: "This prevents the navigation from being instant..." vs. the default "prevents the route from being prerendered..." string. Adds `BLOCKING_ROUTE_NAVIGATION_EXPLANATION` next to `EXPLANATIONS` in `instant-guidance-data.ts` so all overlay copy stays in one place. Also renames the legacy `'navigation'` value of `GuidanceVariant` to `'dynamic'` — the original name meant "uncached data" (from #92638) and collides with the new in-navigation concept. The new shape is `'runtime' | 'dynamic'` for what kind of data is accessed, plus an orthogonal `inNavigation: boolean` for the phase. Co-authored-by: Cursor --- .../instant/instant-guidance-data.ts | 7 +++-- .../dev-overlay/container/errors.tsx | 30 ++++++++++++++----- 2 files changed, 27 insertions(+), 10 deletions(-) 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 bb8f84b50aee..a04581f5e148 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 @@ -391,7 +391,7 @@ export type GuidanceKind = | 'sync-io' | 'sync-io-client' -export type GuidanceVariant = 'runtime' | 'navigation' +export type GuidanceVariant = 'runtime' | 'dynamic' export const DOCS_URLS: Record = { 'blocking-route': 'https://nextjs.org/docs/messages/blocking-route', @@ -467,6 +467,9 @@ export const EXPLANATIONS: Record = { 'This value would be evaluated during the prerender and fixed at build time, instead of recomputed on each visit.', } +export const BLOCKING_ROUTE_NAVIGATION_EXPLANATION = + 'This prevents the navigation from being instant, leading to a slower user experience.' + const syncCardsByCause: Record = { 'Math.random()': syncMathCards, 'Date.now()': syncDateCards, @@ -506,7 +509,7 @@ export function getCards( ): FixCard[] { switch (kind) { case 'blocking-route': - return variant === 'navigation' ? dynamicCards : runtimeCards + return variant === 'dynamic' ? dynamicCards : runtimeCards case 'metadata': return variant === 'runtime' ? metadataRuntimeCards : metadataDynamicCards case 'viewport': 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 613340dbdd93..2070f6421a1d 100644 --- a/packages/next/src/next-devtools/dev-overlay/container/errors.tsx +++ b/packages/next/src/next-devtools/dev-overlay/container/errors.tsx @@ -25,6 +25,7 @@ import { type GuidanceKind, type GuidanceVariant, } from '../components/instant/instant-guidance' +import { BLOCKING_ROUTE_NAVIGATION_EXPLANATION } from '../components/instant/instant-guidance-data' import { CodeFrame } from '../components/code-frame/code-frame' import { ErrorOverlayCallStack } from '../components/errors/error-overlay-call-stack/error-overlay-call-stack' import { ErrorCause } from './runtime-error/error-cause' @@ -126,17 +127,18 @@ type HydrationErrorDetails = { type BlockingRouteErrorDetails = { type: 'blocking-route' - variant: 'navigation' | 'runtime' + variant: 'dynamic' | 'runtime' + inNavigation: boolean } type DynamicMetadataErrorDetails = { type: 'dynamic-metadata' - variant: 'navigation' | 'runtime' + variant: 'dynamic' | 'runtime' } type DynamicViewportErrorDetails = { type: 'dynamic-viewport' - variant: 'navigation' | 'runtime' + variant: 'dynamic' | 'runtime' } type SyncIOErrorDetails = { @@ -314,12 +316,15 @@ function isSyncIOClientError(message: string): boolean { function getBlockingRouteErrorDetails(error: Error): null | ErrorDetails { const message = error.message + const inNavigation = + (error as { __nextInstantNav?: unknown }).__nextInstantNav === true const isBlockingPageLoadError = message.includes('/blocking-route') if (isBlockingPageLoadError) { return { type: 'blocking-route', - variant: isRuntimeVariant(message) ? 'runtime' : 'navigation', + variant: isRuntimeVariant(message) ? 'runtime' : 'dynamic', + inNavigation, } } @@ -329,7 +334,7 @@ function getBlockingRouteErrorDetails(error: Error): null | ErrorDetails { if (isDynamicMetadataError) { return { type: 'dynamic-metadata', - variant: isRuntimeVariant(message) ? 'runtime' : 'navigation', + variant: isRuntimeVariant(message) ? 'runtime' : 'dynamic', } } @@ -339,7 +344,7 @@ function getBlockingRouteErrorDetails(error: Error): null | ErrorDetails { if (isBlockingViewportError) { return { type: 'dynamic-viewport', - variant: isRuntimeVariant(message) ? 'runtime' : 'navigation', + variant: isRuntimeVariant(message) ? 'runtime' : 'dynamic', } } @@ -530,8 +535,12 @@ Next.js version: ${props.versionInfo.installed} (${process.env.__NEXT_BUNDLER})\ errorType={errorType} errorMessage={ errorDetails.variant === 'runtime' - ? 'Next.js encountered runtime data during the initial render.' - : 'Next.js encountered uncached data during the initial render.' + ? errorDetails.inNavigation + ? 'Next.js encountered runtime data during a navigation.' + : 'Next.js encountered runtime data during the initial render.' + : errorDetails.inNavigation + ? 'Next.js encountered uncached data during a navigation.' + : 'Next.js encountered uncached data during the initial render.' } onClose={isServerError ? undefined : onClose} debugInfo={debugInfo} @@ -548,6 +557,11 @@ Next.js version: ${props.versionInfo.installed} (${process.env.__NEXT_BUNDLER})\ key={activeError.id.toString()} error={activeError} variant={errorDetails.variant} + explanation={ + errorDetails.inNavigation + ? BLOCKING_ROUTE_NAVIGATION_EXPLANATION + : undefined + } dialogResizerRef={dialogResizerRef} /> From 79170014c13690f071af80de7c8f4b7b18a5316e Mon Sep 17 00:00:00 2001 From: Aurora Scharff Date: Thu, 14 May 2026 11:39:01 +0200 Subject: [PATCH 03/34] Detect in-navigation errors via stable message substrings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Object markers on the Error don't survive RSC serialization (`__NEXT_ERROR_CODE` already has a side-channel Map for this same reason), so the previous `__nextInstantNav` property was getting stripped before the dev overlay ever saw it. Switches detection to two structural substrings already present in the user-facing copy: - \`accessed under \`\`\` — only emitted by the in-navigation body factories. The mirrored SSR factories say \`accessed outside of \`\`\`, so the two are unambiguous. - \`Could not validate \`unstable_instant\`\` — already used to detect wrapper errors (E1082 / E1112 / E1113 / E1118), tied to the API name rather than phase wording. Drops the marker helper from `blocking-route-messages.ts`. Co-authored-by: Cursor --- .../dev-overlay/container/errors.tsx | 6 ++- .../src/next-devtools/dev-overlay/shared.ts | 12 +++--- .../app-render/blocking-route-messages.ts | 41 ++++++++----------- 3 files changed, 26 insertions(+), 33 deletions(-) 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 2070f6421a1d..fa58878c3d19 100644 --- a/packages/next/src/next-devtools/dev-overlay/container/errors.tsx +++ b/packages/next/src/next-devtools/dev-overlay/container/errors.tsx @@ -316,8 +316,10 @@ function isSyncIOClientError(message: string): boolean { function getBlockingRouteErrorDetails(error: Error): null | ErrorDetails { const message = error.message - const inNavigation = - (error as { __nextInstantNav?: unknown }).__nextInstantNav === true + // Structural detection: nav body factories say `accessed under ` + // vs. SSR variants which say `accessed outside of `. Object + // markers don't survive RSC serialization, so we read from the message. + const inNavigation = message.includes('accessed under ``') const isBlockingPageLoadError = message.includes('/blocking-route') if (isBlockingPageLoadError) { diff --git a/packages/next/src/next-devtools/dev-overlay/shared.ts b/packages/next/src/next-devtools/dev-overlay/shared.ts index 92e42e210a70..abe4297f670e 100644 --- a/packages/next/src/next-devtools/dev-overlay/shared.ts +++ b/packages/next/src/next-devtools/dev-overlay/shared.ts @@ -281,20 +281,20 @@ function getStackIgnoringStrictMode(stack: string | undefined) { return stack?.split(REACT_ERROR_STACK_BOTTOM_FRAME_REGEX)[0] } -// Errors stamped by the `*InNavigation` factories or wrappers from -// `dynamic-rendering.ts` navigation paths — both clear on nav. Initial-render -// errors lack both signals and persist. +// Two stable signals — both tied to structural facts, not phase wording: +// - Body factories: nav variant says `accessed under \`\``, +// SSR variant says `accessed outside of \`\``. +// - Wrappers: emit `Could not validate \`unstable_instant\``. function getInstantErrorRoute(error: unknown): string | null { if (!error || typeof error !== 'object') return null const message = (error as Error).message if (typeof message !== 'string') return null - const isNavigationFactory = - (error as { __nextInstantNav?: unknown }).__nextInstantNav === true + const isNavigationBody = message.includes('accessed under ``') const isNavigationWrapper = message.includes( 'Could not validate `unstable_instant`' ) - if (!isNavigationFactory && !isNavigationWrapper) return null + if (!isNavigationBody && !isNavigationWrapper) return null const match = /^Route "([^"]+)":/.exec(message) return match ? match[1] : null 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 05ad65912e81..e7ba92e25ea3 100644 --- a/packages/next/src/server/app-render/blocking-route-messages.ts +++ b/packages/next/src/server/app-render/blocking-route-messages.ts @@ -22,36 +22,27 @@ export function createDynamicBodyError(route: string): Error { ) } -function markAsInstantNavigationError(error: Error): Error { - ;(error as { __nextInstantNav?: boolean }).__nextInstantNav = true - return error -} - export function createRuntimeBodyErrorInNavigation(route: string): Error { - return markAsInstantNavigationError( - new Error( - `Route "${route}": Next.js encountered runtime data during the initial render or a navigation.\n\n` + - `\`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` 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` + - ` - 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\n` + - `Learn more: https://nextjs.org/docs/messages/blocking-route` - ) + return new Error( + `Route "${route}": Next.js encountered runtime data during the initial render or a navigation.\n\n` + + `\`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` 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` + + ` - 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\n` + + `Learn more: https://nextjs.org/docs/messages/blocking-route` ) } export function createDynamicBodyErrorInNavigation(route: string): Error { - return markAsInstantNavigationError( - new Error( - `Route "${route}": Next.js encountered uncached data during the initial render or a navigation.\n\n` + - `\`fetch(...)\` or \`connection()\` accessed under \`\` 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` + - ` - Provide a placeholder with \`\` around the data access\n` + - ` - Set \`export const instant = false\` to allow a blocking route\n\n` + - `Learn more: https://nextjs.org/docs/messages/blocking-route` - ) + return new Error( + `Route "${route}": Next.js encountered uncached data during the initial render or a navigation.\n\n` + + `\`fetch(...)\` or \`connection()\` accessed under \`\` 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` + + ` - Provide a placeholder with \`\` around the data access\n` + + ` - Set \`export const instant = false\` to allow a blocking route\n\n` + + `Learn more: https://nextjs.org/docs/messages/blocking-route` ) } From aee125ae593963dd58d6d3fa1570d28ad8d21c5f Mon Sep 17 00:00:00 2001 From: Aurora Scharff Date: Thu, 14 May 2026 11:43:38 +0200 Subject: [PATCH 04/34] Detect dev overlay navigation via history events, not usePathname MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The dev overlay renders in a separate React root mounted at the document body (via `createRoot(container)` in `dev-overlay.browser.tsx`), so the App Router's `PathnameContext` isn't in scope and `usePathname()` returns `null` — making the previous `useClearInstantErrorsOnNav` effect a no-op. Switches to a browser-level subscription: listen for `popstate` (back / forward) and patch `history.pushState` / `history.replaceState` to detect client navigations triggered by `next/link` and `router.push()`. Cleanup restores the originals so the patch is scoped to overlay lifetime. This matches the pattern other dev-overlay code already uses for current path (e.g. `route-info.tsx` reads `window.location.pathname` directly). Co-authored-by: Cursor --- .../next-devtools/dev-overlay/dev-overlay.tsx | 39 ++++++++++++++----- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/packages/next/src/next-devtools/dev-overlay/dev-overlay.tsx b/packages/next/src/next-devtools/dev-overlay/dev-overlay.tsx index 9dab2d5f3d42..2cdce85a539a 100644 --- a/packages/next/src/next-devtools/dev-overlay/dev-overlay.tsx +++ b/packages/next/src/next-devtools/dev-overlay/dev-overlay.tsx @@ -1,5 +1,4 @@ import { createContext, useContext, useEffect, useRef, useState } from 'react' -import { usePathname } from '../../client/components/navigation' import { ShadowPortal } from './components/shadow-portal' import { ComponentStyles } from './styles/component-styles' import { ErrorOverlay } from './components/errors/error-overlay/error-overlay' @@ -19,19 +18,39 @@ export const RenderErrorContext = createContext<{ export const useRenderErrorContext = () => useContext(RenderErrorContext) +// The dev overlay renders in a separate React root mounted at the document +// body, so `usePathname()` from the App Router context isn't available here. +// Subscribe to history events directly instead. function useClearInstantErrorsOnNav( dispatch: (action: DispatcherEvent) => void ) { - const pathname = usePathname() - const previousPathnameRef = useRef(pathname) useEffect(() => { - if (previousPathnameRef.current === pathname) return - previousPathnameRef.current = pathname - dispatch({ - type: ACTION_INSTANT_ERRORS_CLEAR, - currentPath: pathname ?? '', - }) - }, [pathname, dispatch]) + let previousPath = window.location.pathname + const fireIfChanged = () => { + const currentPath = window.location.pathname + if (currentPath === previousPath) return + previousPath = currentPath + dispatch({ type: ACTION_INSTANT_ERRORS_CLEAR, currentPath }) + } + + window.addEventListener('popstate', fireIfChanged) + const originalPushState = history.pushState + const originalReplaceState = history.replaceState + history.pushState = function (...args) { + originalPushState.apply(this, args) + fireIfChanged() + } + history.replaceState = function (...args) { + originalReplaceState.apply(this, args) + fireIfChanged() + } + + return () => { + window.removeEventListener('popstate', fireIfChanged) + history.pushState = originalPushState + history.replaceState = originalReplaceState + } + }, [dispatch]) } export function DevOverlay() { From 80685aeb4384c7d86938e10dc7a7ac16b2e64fc5 Mon Sep 17 00:00:00 2001 From: Aurora Scharff Date: Thu, 14 May 2026 11:45:19 +0200 Subject: [PATCH 05/34] Trim comments Co-authored-by: Cursor --- .../next/src/next-devtools/dev-overlay/container/errors.tsx | 5 ++--- packages/next/src/next-devtools/dev-overlay/dev-overlay.tsx | 5 ++--- packages/next/src/next-devtools/dev-overlay/shared.ts | 4 ---- 3 files changed, 4 insertions(+), 10 deletions(-) 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 fa58878c3d19..e27706a07685 100644 --- a/packages/next/src/next-devtools/dev-overlay/container/errors.tsx +++ b/packages/next/src/next-devtools/dev-overlay/container/errors.tsx @@ -316,9 +316,8 @@ function isSyncIOClientError(message: string): boolean { function getBlockingRouteErrorDetails(error: Error): null | ErrorDetails { const message = error.message - // Structural detection: nav body factories say `accessed under ` - // vs. SSR variants which say `accessed outside of `. Object - // markers don't survive RSC serialization, so we read from the message. + // Nav body factory variants say `accessed under `; SSR variants + // say `accessed outside of `. const inNavigation = message.includes('accessed under ``') const isBlockingPageLoadError = message.includes('/blocking-route') diff --git a/packages/next/src/next-devtools/dev-overlay/dev-overlay.tsx b/packages/next/src/next-devtools/dev-overlay/dev-overlay.tsx index 2cdce85a539a..cac1bacf1741 100644 --- a/packages/next/src/next-devtools/dev-overlay/dev-overlay.tsx +++ b/packages/next/src/next-devtools/dev-overlay/dev-overlay.tsx @@ -18,9 +18,8 @@ export const RenderErrorContext = createContext<{ export const useRenderErrorContext = () => useContext(RenderErrorContext) -// The dev overlay renders in a separate React root mounted at the document -// body, so `usePathname()` from the App Router context isn't available here. -// Subscribe to history events directly instead. +// `usePathname()` is unavailable here — the overlay is in its own React root +// outside the App Router context. Listen to history events directly. function useClearInstantErrorsOnNav( dispatch: (action: DispatcherEvent) => void ) { diff --git a/packages/next/src/next-devtools/dev-overlay/shared.ts b/packages/next/src/next-devtools/dev-overlay/shared.ts index abe4297f670e..6f1da3e97fbb 100644 --- a/packages/next/src/next-devtools/dev-overlay/shared.ts +++ b/packages/next/src/next-devtools/dev-overlay/shared.ts @@ -281,10 +281,6 @@ function getStackIgnoringStrictMode(stack: string | undefined) { return stack?.split(REACT_ERROR_STACK_BOTTOM_FRAME_REGEX)[0] } -// Two stable signals — both tied to structural facts, not phase wording: -// - Body factories: nav variant says `accessed under \`\``, -// SSR variant says `accessed outside of \`\``. -// - Wrappers: emit `Could not validate \`unstable_instant\``. function getInstantErrorRoute(error: unknown): string | null { if (!error || typeof error !== 'object') return null const message = (error as Error).message From 32b16b9ddcc2502fd3c521b157b5b531a70a7148 Mon Sep 17 00:00:00 2001 From: Aurora Scharff Date: Thu, 14 May 2026 14:30:38 +0200 Subject: [PATCH 06/34] add missing reducer action --- .../next-devtools/dev-overlay/storybook/use-overlay-reducer.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/next/src/next-devtools/dev-overlay/storybook/use-overlay-reducer.ts b/packages/next/src/next-devtools/dev-overlay/storybook/use-overlay-reducer.ts index d664ff5f84bb..891589ec46d2 100644 --- a/packages/next/src/next-devtools/dev-overlay/storybook/use-overlay-reducer.ts +++ b/packages/next/src/next-devtools/dev-overlay/storybook/use-overlay-reducer.ts @@ -8,6 +8,7 @@ import { ACTION_BUILDING_INDICATOR_HIDE, ACTION_BUILDING_INDICATOR_SHOW, ACTION_CACHE_INDICATOR, + ACTION_INSTANT_ERRORS_CLEAR, ACTION_INSTANT_NAVS_TOGGLE, ACTION_INSTANT_NAVS_RESET, ACTION_DEBUG_INFO, @@ -85,6 +86,7 @@ export function useStorybookOverlayReducer(initialState?: OverlayState) { case ACTION_RENDERING_INDICATOR_HIDE: case ACTION_RENDERING_INDICATOR_SHOW: case ACTION_CACHE_INDICATOR: + case ACTION_INSTANT_ERRORS_CLEAR: case ACTION_INSTANT_NAVS_TOGGLE: case ACTION_INSTANT_NAVS_RESET: case ACTION_STATIC_INDICATOR: From bdf8d8011f945d288b17e6c7aba43975ebb03c38 Mon Sep 17 00:00:00 2001 From: Aurora Scharff Date: Thu, 14 May 2026 15:45:45 +0200 Subject: [PATCH 07/34] Update tests --- .../instant-validation-causes.test.ts | 16 +++++++-------- .../instant-validation-level-error.test.ts | 20 +++++++++---------- ...tant-validation-level-manual-error.test.ts | 12 +++++------ ...nt-validation-level-manual-warning.test.ts | 12 +++++------ .../instant-validation-level-warning.test.ts | 20 +++++++++---------- 5 files changed, 40 insertions(+), 40 deletions(-) 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 d79b24574e98..be2fc1ff29b5 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,8 +105,8 @@ describe('instant validation causes', () => { ], }, ], - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1247", + "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/named-export/page.tsx (7:16) @ Page @@ -136,8 +136,8 @@ describe('instant validation causes', () => { ], }, ], - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1247", + "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/aliased-export/page.tsx (7:16) @ Page @@ -167,8 +167,8 @@ describe('instant validation causes', () => { ], }, ], - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1247", + "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/reexport/page.tsx (6:16) @ Page @@ -201,8 +201,8 @@ describe('instant validation causes', () => { ], }, ], - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1247", + "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/indirect-export/page.tsx (8:16) @ Page 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 84417eae91f7..e4d0aa3e2730 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,8 +60,8 @@ describe('instant validation - level error', () => { const browser = await next.browser('/bare') await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1220", - "description": "Next.js encountered uncached data during the initial render.", + "code": "E1246", + "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/bare/page.tsx (11:19) @ Page @@ -90,8 +90,8 @@ describe('instant validation - level error', () => { ], }, ], - "code": "E1220", - "description": "Next.js encountered uncached data during the initial render.", + "code": "E1246", + "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/explicit-error/page.tsx (11:19) @ Page @@ -120,8 +120,8 @@ describe('instant validation - level error', () => { ], }, ], - "code": "E1220", - "description": "Next.js encountered uncached data during the initial render.", + "code": "E1246", + "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/explicit-true/page.tsx (12:19) @ Page @@ -150,8 +150,8 @@ describe('instant validation - level error', () => { ], }, ], - "code": "E1220", - "description": "Next.js encountered uncached data during the initial render.", + "code": "E1246", + "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/explicit-warning/page.tsx (11:19) @ Page @@ -177,8 +177,8 @@ describe('instant validation - level error', () => { const browser = await next.browser('/layered') await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1220", - "description": "Next.js encountered uncached data during the initial render.", + "code": "E1246", + "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/layered/page.tsx (8:19) @ Page 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 1b78c6d380b2..d643de065f0d 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,8 +79,8 @@ describe('instant validation - level manual-error', () => { ], }, ], - "code": "E1220", - "description": "Next.js encountered uncached data during the initial render.", + "code": "E1246", + "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/explicit-error/page.tsx (11:19) @ Page @@ -109,8 +109,8 @@ describe('instant validation - level manual-error', () => { ], }, ], - "code": "E1220", - "description": "Next.js encountered uncached data during the initial render.", + "code": "E1246", + "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/explicit-true/page.tsx (12:19) @ Page @@ -139,8 +139,8 @@ describe('instant validation - level manual-error', () => { ], }, ], - "code": "E1220", - "description": "Next.js encountered uncached data during the initial render.", + "code": "E1246", + "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/explicit-warning/page.tsx (11:19) @ Page 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 3f0e9e88a20f..e88234392c65 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,8 +93,8 @@ describe('instant validation - level manual-warning', () => { ], }, ], - "code": "E1220", - "description": "Next.js encountered uncached data during the initial render.", + "code": "E1246", + "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/with-root-suspense/explicit-error/page.tsx (11:19) @ Page @@ -125,8 +125,8 @@ describe('instant validation - level manual-warning', () => { ], }, ], - "code": "E1220", - "description": "Next.js encountered uncached data during the initial render.", + "code": "E1246", + "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/with-root-suspense/explicit-true/page.tsx (10:19) @ Page @@ -157,8 +157,8 @@ describe('instant validation - level manual-warning', () => { ], }, ], - "code": "E1220", - "description": "Next.js encountered uncached data during the initial render.", + "code": "E1246", + "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/with-root-suspense/explicit-warning/page.tsx (9:19) @ Page 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 f5cbb87854cf..3cc501d521ea 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,8 +60,8 @@ describe('instant validation - level warning', () => { const browser = await next.browser('/bare') await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1220", - "description": "Next.js encountered uncached data during the initial render.", + "code": "E1246", + "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/bare/page.tsx (10:19) @ Page @@ -90,8 +90,8 @@ describe('instant validation - level warning', () => { ], }, ], - "code": "E1220", - "description": "Next.js encountered uncached data during the initial render.", + "code": "E1246", + "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/explicit-error/page.tsx (10:19) @ Page @@ -120,8 +120,8 @@ describe('instant validation - level warning', () => { ], }, ], - "code": "E1220", - "description": "Next.js encountered uncached data during the initial render.", + "code": "E1246", + "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/explicit-true/page.tsx (11:19) @ Page @@ -150,8 +150,8 @@ describe('instant validation - level warning', () => { ], }, ], - "code": "E1220", - "description": "Next.js encountered uncached data during the initial render.", + "code": "E1246", + "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/explicit-warning/page.tsx (11:19) @ Page @@ -177,8 +177,8 @@ describe('instant validation - level warning', () => { const browser = await next.browser('/layered') await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1220", - "description": "Next.js encountered uncached data during the initial render.", + "code": "E1246", + "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/layered/page.tsx (8:19) @ Page From 8ae10a721e9ce45f9e9de62dbf2beb3fda883d1c Mon Sep 17 00:00:00 2001 From: Aurora Scharff Date: Thu, 14 May 2026 20:30:59 +0200 Subject: [PATCH 08/34] Update tests --- .../instant-validation.test.ts | 124 +++++++++--------- 1 file changed, 62 insertions(+), 62 deletions(-) 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 ab37c9562d47..c4a02dc5b7ca 100644 --- a/test/e2e/app-dir/instant-validation/instant-validation.test.ts +++ b/test/e2e/app-dir/instant-validation/instant-validation.test.ts @@ -180,8 +180,8 @@ describe('instant validation', () => { ], }, ], - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1247", + "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/suspense-in-root/static/missing-suspense-around-runtime/page.tsx (6:16) @ Page @@ -240,8 +240,8 @@ describe('instant validation', () => { ], }, ], - "code": "E1220", - "description": "Next.js encountered uncached data during the initial render.", + "code": "E1246", + "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/suspense-in-root/static/missing-suspense-around-dynamic/page.tsx (6:19) @ Page @@ -300,8 +300,8 @@ describe('instant validation', () => { ], }, ], - "code": "E1220", - "description": "Next.js encountered uncached data during the initial render.", + "code": "E1246", + "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/suspense-in-root/runtime/missing-suspense-around-dynamic/page.tsx (23:19) @ Dynamic @@ -363,8 +363,8 @@ describe('instant validation', () => { ], }, ], - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1247", + "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/suspense-in-root/static/missing-suspense-around-dynamic-layout/layout.tsx (7:16) @ Layout @@ -423,8 +423,8 @@ describe('instant validation', () => { ], }, ], - "code": "E1220", - "description": "Next.js encountered uncached data during the initial render.", + "code": "E1246", + "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/suspense-in-root/runtime/missing-suspense-around-dynamic-layout/layout.tsx (8:19) @ Layout @@ -486,8 +486,8 @@ describe('instant validation', () => { ], }, ], - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1247", + "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/suspense-in-root/static/missing-suspense-around-params/[param]/page.tsx (20:21) @ Runtime @@ -534,8 +534,8 @@ describe('instant validation', () => { ], }, ], - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1247", + "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/suspense-in-root/static/missing-suspense-around-search-params/page.tsx (7:18) @ Page @@ -629,8 +629,8 @@ describe('instant validation', () => { ], }, ], - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1247", + "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/suspense-in-root/static/suspense-too-high/page.tsx (6:16) @ Page @@ -692,8 +692,8 @@ describe('instant validation', () => { ], }, ], - "code": "E1220", - "description": "Next.js encountered uncached data during the initial render.", + "code": "E1246", + "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/suspense-in-root/runtime/suspense-too-high/page.tsx (24:19) @ Dynamic @@ -1231,8 +1231,8 @@ describe('instant validation', () => { ], }, ], - "code": "E1220", - "description": "Next.js encountered uncached data during the initial render.", + "code": "E1246", + "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/suspense-in-root/static/invalid-loading-above-route-group/(group)/page.tsx (34:19) @ Dynamic @@ -1295,8 +1295,8 @@ describe('instant validation', () => { ], }, ], - "code": "E1220", - "description": "Next.js encountered uncached data during the initial render.", + "code": "E1246", + "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/suspense-in-root/static/invalid-dynamic-layout-with-loading/layout.tsx (24:19) @ Dynamic @@ -1372,8 +1372,8 @@ describe('instant validation', () => { ], }, ], - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1247", + "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/suspense-in-root/static/blocking-layout/missing-suspense-around-dynamic/page.tsx (6:16) @ Page @@ -1460,8 +1460,8 @@ describe('instant validation', () => { ], }, ], - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1247", + "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/suspense-in-root/static/invalid-blocking-inside-static/page.tsx (6:16) @ BlockingPage @@ -1521,8 +1521,8 @@ describe('instant validation', () => { ], }, ], - "code": "E1220", - "description": "Next.js encountered uncached data during the initial render.", + "code": "E1246", + "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/suspense-in-root/runtime/invalid-blocking-inside-runtime/page.tsx (6:19) @ BlockingPage @@ -1585,8 +1585,8 @@ describe('instant validation', () => { ], }, ], - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1247", + "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/suspense-in-root/static/missing-suspense-in-parallel-route/@slot/page.tsx (4:16) @ IndexSlot @@ -1647,8 +1647,8 @@ describe('instant validation', () => { ], }, ], - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1247", + "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/suspense-in-root/static/missing-suspense-in-parallel-route/@slot/foo/page.tsx (4:16) @ FooSlot @@ -1709,8 +1709,8 @@ describe('instant validation', () => { ], }, ], - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1247", + "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/suspense-in-root/static/missing-suspense-in-parallel-route/@slot/default.tsx (4:16) @ DefaultSlot @@ -2580,8 +2580,8 @@ describe('instant validation', () => { ], }, ], - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1247", + "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/suspense-in-root/static/route-group-config-only/(group)/page.tsx (4:16) @ Page @@ -2641,8 +2641,8 @@ describe('instant validation', () => { ], }, ], - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1247", + "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/suspense-in-root/static/route-group-config-and-segment-config/(group)/page.tsx (4:16) @ Page @@ -2703,8 +2703,8 @@ describe('instant validation', () => { ], }, ], - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1247", + "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/suspense-in-root/static/route-group-segment-config-only/(group)/page.tsx (4:16) @ Page @@ -2765,8 +2765,8 @@ describe('instant validation', () => { ], }, ], - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1247", + "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/suspense-in-root/static/route-group-config-with-deeper-segment/(group)/inner/page.tsx (4:16) @ Page @@ -2827,8 +2827,8 @@ describe('instant validation', () => { ], }, ], - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1247", + "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/suspense-in-root/static/route-group-deeper-segment-config/(group)/inner/page.tsx (4:16) @ Page @@ -2896,8 +2896,8 @@ describe('instant validation', () => { ], }, ], - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1247", + "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/suspense-in-root/static/route-group-shared-boundary/(outer)/(inner)/layout.tsx (13:16) @ InnerLayout @@ -2972,8 +2972,8 @@ describe('instant validation', () => { ], }, ], - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1247", + "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/suspense-in-root/static/parallel-group-depths-deep-slot-hole/@slot/(g1)/(g2)/(g3)/layout.tsx (7:16) @ G3Layout @@ -3042,8 +3042,8 @@ describe('instant validation', () => { ], }, ], - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1247", + "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/suspense-in-root/static/parallel-group-depths-shallow-slot-hole/(b1)/(b2)/layout.tsx (5:16) @ B2Layout @@ -3113,8 +3113,8 @@ describe('instant validation', () => { ], }, ], - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1247", + "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/suspense-in-root/runtime/static-layout-above-runtime-config/layout.tsx (15:16) @ StaticLayout @@ -3181,8 +3181,8 @@ describe('instant validation', () => { ], }, ], - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1247", + "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/suspense-in-root/static/config-depth-preference/@slot/[...catchall]/page.tsx (8:16) @ CatchallSlotPage @@ -3232,8 +3232,8 @@ describe('instant validation', () => { ], }, ], - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1247", + "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/suspense-in-root/static/config-depth-preference-slot-wins/@slot/[...catchall]/page.tsx (7:16) @ CatchallSlotPage @@ -3296,8 +3296,8 @@ describe('instant validation', () => { ], }, ], - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1247", + "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/suspense-in-root/static/config-children-preferred/@slot/page.tsx (7:16) @ SlotPage @@ -3361,8 +3361,8 @@ describe('instant validation', () => { ], }, ], - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1247", + "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/suspense-in-root/static/cross-slot-blocking/@slot/[...catchall]/page.tsx (8:16) @ CatchallSlotPage @@ -3539,8 +3539,8 @@ describe('instant validation', () => { ], }, ], - "code": "E1220", - "description": "Next.js encountered uncached data during the initial render.", + "code": "E1246", + "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/suspense-in-root/disable-validation/disable-build/page.tsx (9:19) @ Page From 7bbd86003a50470d6c15386c0bc8b61f40106ae9 Mon Sep 17 00:00:00 2001 From: Aurora Scharff Date: Thu, 14 May 2026 21:46:58 +0200 Subject: [PATCH 09/34] Update snapshots for in-navigation factory wording MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The new `createRuntimeBodyErrorInNavigation` / `createDynamicBodyErrorInNavigation` factories produce "encountered runtime data during a navigation" wording in the dev overlay (via inNavigation substring detection in errors.tsx). Seven inline snapshots in instant-validation-parallel-slots.test.ts locked in the older "during the initial render" + E1221 / E1220 wording — flipped to the new "during a navigation" + E1247 / E1246. The eighth test in this file is left at canary state: it relies on PR #93770's "expected segment was not rendered" message which currently bakes in a test/tmp/next-test-… absolute path. That test is broken on canary HEAD too (verified directly) — not a regression from this PR. Co-authored-by: Cursor --- .../instant-validation-parallel-slots.test.ts | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) 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 9fb825531120..84aa13490629 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,8 +124,8 @@ describe('instant validation - parallel slot configs', () => { ], }, ], - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1247", + "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/suspense-in-root/parallel/slot-config-only/page.tsx (4:16) @ ChildrenPage @@ -184,8 +184,8 @@ describe('instant validation - parallel slot configs', () => { ], }, ], - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1247", + "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/suspense-in-root/parallel/slot-layout-config/page.tsx (4:16) @ ChildrenPage @@ -244,8 +244,8 @@ describe('instant validation - parallel slot configs', () => { ], }, ], - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1247", + "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/suspense-in-root/parallel/slot-runtime-config/page.tsx (4:16) @ ChildrenPage @@ -306,8 +306,8 @@ describe('instant validation - parallel slot configs', () => { ], }, ], - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1247", + "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/suspense-in-root/parallel/children-config-with-slot/@slot/page.tsx (4:16) @ SlotPage @@ -368,8 +368,8 @@ describe('instant validation - parallel slot configs', () => { ], }, ], - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1247", + "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/suspense-in-root/parallel/fork-layout-config-with-slot/@slot/page.tsx (4:16) @ SlotPage @@ -392,8 +392,8 @@ describe('instant validation - parallel slot configs', () => { ], }, ], - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1247", + "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/suspense-in-root/parallel/fork-layout-config-with-slot/page.tsx (4:16) @ ChildrenPage @@ -535,8 +535,8 @@ describe('instant validation - parallel slot configs', () => { ], }, ], - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1247", + "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/suspense-in-root/parallel/conditional-breadcrumbs/show-both/@breadcrumbs/blocked/page.tsx (3:16) @ BreadcrumbsPage @@ -650,8 +650,8 @@ describe('instant validation - parallel slot configs', () => { ], }, ], - "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "code": "E1247", + "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/suspense-in-root/parallel/conditional-breadcrumbs/show-only-breadcrumbs/@breadcrumbs/blocked/page.tsx (3:16) @ BreadcrumbsPage From b221f22e87463277206460e8d86a7074ce61a25e Mon Sep 17 00:00:00 2001 From: Aurora Scharff Date: Thu, 14 May 2026 21:57:51 +0200 Subject: [PATCH 10/34] Update build-mode snapshots for in-navigation factory wording `instant-validation.test.ts` (28 snapshots) and `instant-validation-parallel-slots.test.ts` (7 snapshots) had build-mode inline snapshots that pinned the older `createRuntimeBodyError` / `createDynamicBodyError` wording. Switched to the new in-navigation factory output: - "encountered runtime data during the initial render." + "encountered runtime data during the initial render or a navigation." - "accessed outside of `` prevents the route from being prerendered, blocking navigation and leading to a slower user experience." + "accessed under `` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience." Captured without NEXT_SKIP_ISOLATE so the test packed next.js as a tarball (matching the CI build path); avoids leaking local `../../../packages/next/dist/esm/...` stack frames into the snapshots. Co-authored-by: Cursor --- .../instant-validation-parallel-slots.test.ts | 48 +++--- .../instant-validation.test.ts | 152 +++++++++--------- 2 files changed, 100 insertions(+), 100 deletions(-) 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 84aa13490629..76dc94e951f0 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 @@ -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. + "Error: Route "/suspense-in-root/parallel/slot-config-only": Next.js encountered runtime data during the initial render or a navigation. - \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` 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 + - Provide a placeholder with \`\` around the data access - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -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. + "Error: Route "/suspense-in-root/parallel/slot-layout-config": Next.js encountered runtime data during the initial render or a navigation. - \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` 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 + - Provide a placeholder with \`\` around the data access - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -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. + "Error: Route "/suspense-in-root/parallel/slot-runtime-config": Next.js encountered runtime data during the initial render or a navigation. - \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` 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 + - Provide a placeholder with \`\` around the data access - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -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. + "Error: Route "/suspense-in-root/parallel/children-config-with-slot": Next.js encountered runtime data during the initial render or a navigation. - \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` 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 + - Provide a placeholder with \`\` around the data access - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -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. + "Error: Route "/suspense-in-root/parallel/fork-layout-config-with-slot": Next.js encountered runtime data during the initial render or a navigation. - \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` 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 + - Provide a placeholder with \`\` around the data access - 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. + Error: Route "/suspense-in-root/parallel/fork-layout-config-with-slot": Next.js encountered runtime data during the initial render or a navigation. - \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` 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 + - Provide a placeholder with \`\` around the data access - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -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. + "Error: Route "/suspense-in-root/parallel/conditional-breadcrumbs/show-both/blocked": Next.js encountered runtime data during the initial render or a navigation. - \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` 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 + - Provide a placeholder with \`\` around the data access - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -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. + "Error: Route "/suspense-in-root/parallel/conditional-breadcrumbs/show-only-breadcrumbs/blocked": Next.js encountered runtime data during the initial render or a navigation. - \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` 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 + - Provide a placeholder with \`\` around the data access - 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 fec2301720d9..e81fbde4b391 100644 --- a/test/e2e/app-dir/instant-validation/instant-validation.test.ts +++ b/test/e2e/app-dir/instant-validation/instant-validation.test.ts @@ -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. + "Error: Route "/suspense-in-root/static/missing-suspense-around-runtime": Next.js encountered runtime data during the initial render or a navigation. - \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` 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 + - Provide a placeholder with \`\` around the data access - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -258,9 +258,9 @@ 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. + "Error: Route "/suspense-in-root/static/missing-suspense-around-dynamic": Next.js encountered uncached data during the initial render or a navigation. - \`fetch(...)\` or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`fetch(...)\` or \`connection()\` accessed under \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. Ways to fix this: - Cache the data access with \`"use cache"\` @@ -319,9 +319,9 @@ 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. + "Error: Route "/suspense-in-root/runtime/missing-suspense-around-dynamic": Next.js encountered uncached data during the initial render or a navigation. - \`fetch(...)\` or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`fetch(...)\` or \`connection()\` accessed under \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. Ways to fix this: - Cache the data access with \`"use cache"\` @@ -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. + "Error: Route "/suspense-in-root/static/missing-suspense-around-dynamic-layout": Next.js encountered runtime data during the initial render or a navigation. - \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` 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 + - Provide a placeholder with \`\` around the data access - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -441,9 +441,9 @@ 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. + "Error: Route "/suspense-in-root/runtime/missing-suspense-around-dynamic-layout": Next.js encountered uncached data during the initial render or a navigation. - \`fetch(...)\` or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`fetch(...)\` or \`connection()\` accessed under \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. Ways to fix this: - Cache the data access with \`"use cache"\` @@ -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. + "Error: Route "/suspense-in-root/static/missing-suspense-around-search-params": Next.js encountered runtime data during the initial render or a navigation. - \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` 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 + - Provide a placeholder with \`\` around the data access - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -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. + "Error: Route "/suspense-in-root/static/suspense-too-high": Next.js encountered runtime data during the initial render or a navigation. - \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` 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 + - Provide a placeholder with \`\` around the data access - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -711,9 +711,9 @@ 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. + "Error: Route "/suspense-in-root/runtime/suspense-too-high": Next.js encountered uncached data during the initial render or a navigation. - \`fetch(...)\` or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`fetch(...)\` or \`connection()\` accessed under \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. Ways to fix this: - Cache the data access with \`"use cache"\` @@ -1250,9 +1250,9 @@ 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. + "Error: Route "/suspense-in-root/static/invalid-loading-above-route-group": Next.js encountered uncached data during the initial render or a navigation. - \`fetch(...)\` or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`fetch(...)\` or \`connection()\` accessed under \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. Ways to fix this: - Cache the data access with \`"use cache"\` @@ -1314,9 +1314,9 @@ 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. + "Error: Route "/suspense-in-root/static/invalid-dynamic-layout-with-loading": Next.js encountered uncached data during the initial render or a navigation. - \`fetch(...)\` or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`fetch(...)\` or \`connection()\` accessed under \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. Ways to fix this: - Cache the data access with \`"use cache"\` @@ -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. + "Error: Route "/suspense-in-root/static/blocking-layout/missing-suspense-around-dynamic": Next.js encountered runtime data during the initial render or a navigation. - \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` 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 + - Provide a placeholder with \`\` around the data access - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -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. + "Error: Route "/suspense-in-root/static/invalid-blocking-inside-static": Next.js encountered runtime data during the initial render or a navigation. - \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` 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 + - Provide a placeholder with \`\` around the data access - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -1539,9 +1539,9 @@ 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. + "Error: Route "/suspense-in-root/runtime/invalid-blocking-inside-runtime": Next.js encountered uncached data during the initial render or a navigation. - \`fetch(...)\` or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`fetch(...)\` or \`connection()\` accessed under \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. Ways to fix this: - Cache the data access with \`"use cache"\` @@ -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. + "Error: Route "/suspense-in-root/static/missing-suspense-in-parallel-route": Next.js encountered runtime data during the initial render or a navigation. - \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` 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 + - Provide a placeholder with \`\` around the data access - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -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. + "Error: Route "/suspense-in-root/static/missing-suspense-in-parallel-route/foo": Next.js encountered runtime data during the initial render or a navigation. - \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` 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 + - Provide a placeholder with \`\` around the data access - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -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. + "Error: Route "/suspense-in-root/static/missing-suspense-in-parallel-route/bar": Next.js encountered runtime data during the initial render or a navigation. - \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` 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 + - Provide a placeholder with \`\` around the data access - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -2598,13 +2598,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. + "Error: Route "/suspense-in-root/static/route-group-config-only": Next.js encountered runtime data during the initial render or a navigation. - \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` 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 + - Provide a placeholder with \`\` around the data access - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -2659,13 +2659,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. + "Error: Route "/suspense-in-root/static/route-group-config-and-segment-config": Next.js encountered runtime data during the initial render or a navigation. - \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` 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 + - Provide a placeholder with \`\` around the data access - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -2721,13 +2721,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. + "Error: Route "/suspense-in-root/static/route-group-segment-config-only": Next.js encountered runtime data during the initial render or a navigation. - \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` 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 + - Provide a placeholder with \`\` around the data access - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -2783,13 +2783,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. + "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. - \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` 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 + - Provide a placeholder with \`\` around the data access - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -2845,13 +2845,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. + "Error: Route "/suspense-in-root/static/route-group-deeper-segment-config/inner": Next.js encountered runtime data during the initial render or a navigation. - \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` 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 + - Provide a placeholder with \`\` around the data access - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -2914,13 +2914,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. + "Error: Route "/suspense-in-root/static/route-group-shared-boundary": Next.js encountered runtime data during the initial render or a navigation. - \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` 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 + - Provide a placeholder with \`\` around the data access - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -2990,13 +2990,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. + "Error: Route "/suspense-in-root/static/parallel-group-depths-deep-slot-hole": Next.js encountered runtime data during the initial render or a navigation. - \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` 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 + - Provide a placeholder with \`\` around the data access - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -3060,13 +3060,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. + "Error: Route "/suspense-in-root/static/parallel-group-depths-shallow-slot-hole": Next.js encountered runtime data during the initial render or a navigation. - \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` 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 + - Provide a placeholder with \`\` around the data access - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -3131,13 +3131,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. + "Error: Route "/suspense-in-root/runtime/static-layout-above-runtime-config/inner": Next.js encountered runtime data during the initial render or a navigation. - \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` 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 + - Provide a placeholder with \`\` around the data access - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -3250,13 +3250,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. + "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. - \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` 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 + - Provide a placeholder with \`\` around the data access - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -3314,13 +3314,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. + "Error: Route "/suspense-in-root/static/config-children-preferred": Next.js encountered runtime data during the initial render or a navigation. - \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` 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 + - Provide a placeholder with \`\` around the data access - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -3646,9 +3646,9 @@ 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. + "Error: Route "/suspense-in-root/disable-validation/disable-dev": Next.js encountered uncached data during the initial render or a navigation. - \`fetch(...)\` or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`fetch(...)\` or \`connection()\` accessed under \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. Ways to fix this: - Cache the data access with \`"use cache"\` From bf68fea548aad77da7bda26607a7ca9e57d4aafa Mon Sep 17 00:00:00 2001 From: Aurora Scharff Date: Thu, 14 May 2026 22:20:17 +0200 Subject: [PATCH 11/34] Align InNavigation factory wording, extract isBlockingRouteInNavError MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The in-navigation body factories said "accessed under \`\`", which contradicts the fix bullet that recommends wrapping in Suspense. The actual problem is the same as the SSR factories: data accessed *outside* a Suspense boundary, where the prerender / prefetchable shell can't proceed without waiting. Aligned both InNavigation factories to "accessed outside of \`\`" so the diagnostic matches the SSR factories — only the consequence clause differs (still includes "or the navigation from being instant"). Refactored the substring detection that distinguishes in-navigation vs SSR variants into a single `isBlockingRouteInNavError` helper in `shared.ts`, used by both `getInstantErrorRoute` (clear-on-nav) and `getBlockingRouteErrorDetails` (overlay headline phase). Helper keys off "or a navigation" which is still unique to the InNavigation factory pair (the diagnostic clause is now shared). Also narrowed `getInstantErrorRoute` to detect *only* body factory errors — wrapper errors like "Could not validate \`unstable_instant\`" are no longer cleared on navigation. They describe a validation infrastructure failure rather than a fixable route-level mistake and should stay in the redbox stack until the user addresses the cause. Snapshot updates across `instant-validation.test.ts` (dev + build modes) and `instant-validation-parallel-slots.test.ts` (dev + build modes) reflect the new wording. Build-mode snapshots captured without NEXT_SKIP_ISOLATE so the test packs Next.js as a tarball and produces the same stack frame shape CI sees (avoids leaking local dist paths). Co-authored-by: Cursor --- packages/next/errors.json | 4 +- .../dev-overlay/container/errors.tsx | 5 +- .../src/next-devtools/dev-overlay/shared.ts | 15 +- .../app-render/blocking-route-messages.ts | 4 +- .../instant-validation-parallel-slots.test.ts | 36 ++--- .../instant-validation.test.ts | 132 +++++++++--------- 6 files changed, 99 insertions(+), 97 deletions(-) diff --git a/packages/next/errors.json b/packages/next/errors.json index 878e0da6534b..6bbb4f547460 100644 --- a/packages/next/errors.json +++ b/packages/next/errors.json @@ -1246,5 +1246,7 @@ "1245": "A \"use cache\" with zero \\`revalidate\\` is nested inside another \"use cache\" that has no explicit \\`cacheLife\\`, which is not allowed during prerendering. Add \\`cacheLife()\\` to the outer \"use cache\" to choose whether it should be prerendered (with non-zero \\`revalidate\\`) or remain dynamic (with zero \\`revalidate\\`). Read more: https://nextjs.org/docs/messages/nested-use-cache-no-explicit-cachelife", "1246": "Route \"%s\": Next.js encountered uncached data during the initial render or a navigation.\\n\\n\\`fetch(...)\\` or \\`connection()\\` accessed under \\`\\` 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", "1247": "Route \"%s\": Next.js encountered runtime data during the initial render or a navigation.\\n\\n\\`cookies()\\`, \\`headers()\\`, \\`params\\`, or \\`searchParams\\` accessed under \\`\\` 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", - "1248": "Could not validate instant UI because an expected segment was not rendered." + "1248": "Could not validate instant UI because an expected segment was not rendered.", + "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" } 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 e27706a07685..2f1c553c6dfa 100644 --- a/packages/next/src/next-devtools/dev-overlay/container/errors.tsx +++ b/packages/next/src/next-devtools/dev-overlay/container/errors.tsx @@ -26,6 +26,7 @@ import { type GuidanceVariant, } from '../components/instant/instant-guidance' import { BLOCKING_ROUTE_NAVIGATION_EXPLANATION } from '../components/instant/instant-guidance-data' +import { isBlockingRouteInNavError } from '../shared' import { CodeFrame } from '../components/code-frame/code-frame' import { ErrorOverlayCallStack } from '../components/errors/error-overlay-call-stack/error-overlay-call-stack' import { ErrorCause } from './runtime-error/error-cause' @@ -316,9 +317,7 @@ function isSyncIOClientError(message: string): boolean { function getBlockingRouteErrorDetails(error: Error): null | ErrorDetails { const message = error.message - // Nav body factory variants say `accessed under `; SSR variants - // say `accessed outside of `. - const inNavigation = message.includes('accessed under ``') + const inNavigation = isBlockingRouteInNavError(message) const isBlockingPageLoadError = message.includes('/blocking-route') if (isBlockingPageLoadError) { diff --git a/packages/next/src/next-devtools/dev-overlay/shared.ts b/packages/next/src/next-devtools/dev-overlay/shared.ts index 6f1da3e97fbb..6782e67cfd67 100644 --- a/packages/next/src/next-devtools/dev-overlay/shared.ts +++ b/packages/next/src/next-devtools/dev-overlay/shared.ts @@ -281,17 +281,18 @@ function getStackIgnoringStrictMode(stack: string | undefined) { return stack?.split(REACT_ERROR_STACK_BOTTOM_FRAME_REGEX)[0] } +// Detects errors from `createRuntimeBodyErrorInNavigation` / +// `createDynamicBodyErrorInNavigation`. SSR-only factories say "during the +// initial render"; nav factories say "during the initial render or a navigation". +export function isBlockingRouteInNavError(message: string): boolean { + return message.includes('or a navigation') +} + function getInstantErrorRoute(error: unknown): string | null { if (!error || typeof error !== 'object') return null const message = (error as Error).message if (typeof message !== 'string') return null - - const isNavigationBody = message.includes('accessed under ``') - const isNavigationWrapper = message.includes( - 'Could not validate `unstable_instant`' - ) - if (!isNavigationBody && !isNavigationWrapper) return null - + if (!isBlockingRouteInNavError(message)) return null const match = /^Route "([^"]+)":/.exec(message) return match ? match[1] : null } 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 e7ba92e25ea3..85695f8ce0df 100644 --- a/packages/next/src/server/app-render/blocking-route-messages.ts +++ b/packages/next/src/server/app-render/blocking-route-messages.ts @@ -25,7 +25,7 @@ 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` + - `\`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience.\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` + ` - Use \`generateStaticParams\` to make route params static\n` + ` - Provide a placeholder with \`\` around the data access\n` + @@ -37,7 +37,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` + - `\`fetch(...)\` or \`connection()\` accessed under \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience.\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` + ` - Provide a placeholder with \`\` around the data access\n` + 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 76dc94e951f0..44b069fba961 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": "E1247", + "code": "E1250", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -144,7 +144,7 @@ describe('instant validation - parallel slot configs', () => { .toMatchInlineSnapshot(` "Error: Route "/suspense-in-root/parallel/slot-config-only": Next.js encountered runtime data during the initial render or a navigation. - \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. + \`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: - Use \`generateStaticParams\` to make route params static @@ -184,7 +184,7 @@ describe('instant validation - parallel slot configs', () => { ], }, ], - "code": "E1247", + "code": "E1250", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -204,7 +204,7 @@ describe('instant validation - parallel slot configs', () => { .toMatchInlineSnapshot(` "Error: Route "/suspense-in-root/parallel/slot-layout-config": Next.js encountered runtime data during the initial render or a navigation. - \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. + \`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: - Use \`generateStaticParams\` to make route params static @@ -244,7 +244,7 @@ describe('instant validation - parallel slot configs', () => { ], }, ], - "code": "E1247", + "code": "E1250", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -264,7 +264,7 @@ describe('instant validation - parallel slot configs', () => { .toMatchInlineSnapshot(` "Error: Route "/suspense-in-root/parallel/slot-runtime-config": Next.js encountered runtime data during the initial render or a navigation. - \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. + \`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: - Use \`generateStaticParams\` to make route params static @@ -306,7 +306,7 @@ describe('instant validation - parallel slot configs', () => { ], }, ], - "code": "E1247", + "code": "E1250", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -326,7 +326,7 @@ describe('instant validation - parallel slot configs', () => { .toMatchInlineSnapshot(` "Error: Route "/suspense-in-root/parallel/children-config-with-slot": Next.js encountered runtime data during the initial render or a navigation. - \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. + \`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: - Use \`generateStaticParams\` to make route params static @@ -368,7 +368,7 @@ describe('instant validation - parallel slot configs', () => { ], }, ], - "code": "E1247", + "code": "E1250", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -392,7 +392,7 @@ describe('instant validation - parallel slot configs', () => { ], }, ], - "code": "E1247", + "code": "E1250", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -413,7 +413,7 @@ describe('instant validation - parallel slot configs', () => { .toMatchInlineSnapshot(` "Error: Route "/suspense-in-root/parallel/fork-layout-config-with-slot": Next.js encountered runtime data during the initial render or a navigation. - \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. + \`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: - Use \`generateStaticParams\` to make route params static @@ -427,7 +427,7 @@ describe('instant validation - parallel slot configs', () => { 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. - \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. + \`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: - Use \`generateStaticParams\` to make route params static @@ -535,7 +535,7 @@ describe('instant validation - parallel slot configs', () => { ], }, ], - "code": "E1247", + "code": "E1250", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -553,7 +553,7 @@ describe('instant validation - parallel slot configs', () => { .toMatchInlineSnapshot(` "Error: Route "/suspense-in-root/parallel/conditional-breadcrumbs/show-both/blocked": Next.js encountered runtime data during the initial render or a navigation. - \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. + \`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: - Use \`generateStaticParams\` to make route params static @@ -583,11 +583,11 @@ describe('instant validation - parallel slot configs', () => { const browser = await navigateTo(href) await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1246", + "code": "E1248", "description": "Could not validate instant UI because an expected segment was not rendered. Unrendered segment: - app/suspense-in-root/parallel/conditional-breadcrumbs/show-only-breadcrumbs/unblocked/page.tsx + test/tmp/next-test-1778789286151-152/app/suspense-in-root/parallel/conditional-breadcrumbs/show-only-breadcrumbs/unblocked/page.tsx Route: /suspense-in-root/parallel/conditional-breadcrumbs/show-only-breadcrumbs/unblocked @@ -650,7 +650,7 @@ describe('instant validation - parallel slot configs', () => { ], }, ], - "code": "E1247", + "code": "E1250", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -668,7 +668,7 @@ describe('instant validation - parallel slot configs', () => { .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. - \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. + \`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: - Use \`generateStaticParams\` to make route params static 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 e81fbde4b391..1ef6ad4819cb 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": "E1247", + "code": "E1250", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -200,7 +200,7 @@ describe('instant validation', () => { .toMatchInlineSnapshot(` "Error: Route "/suspense-in-root/static/missing-suspense-around-runtime": Next.js encountered runtime data during the initial render or a navigation. - \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. + \`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: - Use \`generateStaticParams\` to make route params static @@ -240,7 +240,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1246", + "code": "E1249", "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -260,7 +260,7 @@ describe('instant validation', () => { .toMatchInlineSnapshot(` "Error: Route "/suspense-in-root/static/missing-suspense-around-dynamic": Next.js encountered uncached data during the initial render or a navigation. - \`fetch(...)\` or \`connection()\` accessed under \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. + \`fetch(...)\` or \`connection()\` 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: - Cache the data access with \`"use cache"\` @@ -300,7 +300,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1246", + "code": "E1249", "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -321,7 +321,7 @@ describe('instant validation', () => { .toMatchInlineSnapshot(` "Error: Route "/suspense-in-root/runtime/missing-suspense-around-dynamic": Next.js encountered uncached data during the initial render or a navigation. - \`fetch(...)\` or \`connection()\` accessed under \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. + \`fetch(...)\` or \`connection()\` 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: - Cache the data access with \`"use cache"\` @@ -363,7 +363,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1247", + "code": "E1250", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -383,7 +383,7 @@ describe('instant validation', () => { .toMatchInlineSnapshot(` "Error: Route "/suspense-in-root/static/missing-suspense-around-dynamic-layout": Next.js encountered runtime data during the initial render or a navigation. - \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. + \`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: - Use \`generateStaticParams\` to make route params static @@ -423,7 +423,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1246", + "code": "E1249", "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -443,7 +443,7 @@ describe('instant validation', () => { .toMatchInlineSnapshot(` "Error: Route "/suspense-in-root/runtime/missing-suspense-around-dynamic-layout": Next.js encountered uncached data during the initial render or a navigation. - \`fetch(...)\` or \`connection()\` accessed under \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. + \`fetch(...)\` or \`connection()\` 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: - Cache the data access with \`"use cache"\` @@ -486,7 +486,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1247", + "code": "E1250", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -534,7 +534,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1247", + "code": "E1250", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -554,7 +554,7 @@ describe('instant validation', () => { .toMatchInlineSnapshot(` "Error: Route "/suspense-in-root/static/missing-suspense-around-search-params": Next.js encountered runtime data during the initial render or a navigation. - \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. + \`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: - Use \`generateStaticParams\` to make route params static @@ -629,7 +629,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1247", + "code": "E1250", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -649,7 +649,7 @@ describe('instant validation', () => { .toMatchInlineSnapshot(` "Error: Route "/suspense-in-root/static/suspense-too-high": Next.js encountered runtime data during the initial render or a navigation. - \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. + \`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: - Use \`generateStaticParams\` to make route params static @@ -692,7 +692,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1246", + "code": "E1249", "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -713,7 +713,7 @@ describe('instant validation', () => { .toMatchInlineSnapshot(` "Error: Route "/suspense-in-root/runtime/suspense-too-high": Next.js encountered uncached data during the initial render or a navigation. - \`fetch(...)\` or \`connection()\` accessed under \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. + \`fetch(...)\` or \`connection()\` 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: - Cache the data access with \`"use cache"\` @@ -1231,7 +1231,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1246", + "code": "E1249", "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -1252,7 +1252,7 @@ describe('instant validation', () => { .toMatchInlineSnapshot(` "Error: Route "/suspense-in-root/static/invalid-loading-above-route-group": Next.js encountered uncached data during the initial render or a navigation. - \`fetch(...)\` or \`connection()\` accessed under \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. + \`fetch(...)\` or \`connection()\` 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: - Cache the data access with \`"use cache"\` @@ -1295,7 +1295,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1246", + "code": "E1249", "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -1316,7 +1316,7 @@ describe('instant validation', () => { .toMatchInlineSnapshot(` "Error: Route "/suspense-in-root/static/invalid-dynamic-layout-with-loading": Next.js encountered uncached data during the initial render or a navigation. - \`fetch(...)\` or \`connection()\` accessed under \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. + \`fetch(...)\` or \`connection()\` 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: - Cache the data access with \`"use cache"\` @@ -1372,7 +1372,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1247", + "code": "E1250", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -1392,7 +1392,7 @@ describe('instant validation', () => { .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. - \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. + \`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: - Use \`generateStaticParams\` to make route params static @@ -1460,7 +1460,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1247", + "code": "E1250", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -1480,7 +1480,7 @@ describe('instant validation', () => { .toMatchInlineSnapshot(` "Error: Route "/suspense-in-root/static/invalid-blocking-inside-static": Next.js encountered runtime data during the initial render or a navigation. - \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. + \`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: - Use \`generateStaticParams\` to make route params static @@ -1521,7 +1521,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1246", + "code": "E1249", "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -1541,7 +1541,7 @@ describe('instant validation', () => { .toMatchInlineSnapshot(` "Error: Route "/suspense-in-root/runtime/invalid-blocking-inside-runtime": Next.js encountered uncached data during the initial render or a navigation. - \`fetch(...)\` or \`connection()\` accessed under \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. + \`fetch(...)\` or \`connection()\` 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: - Cache the data access with \`"use cache"\` @@ -1585,7 +1585,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1247", + "code": "E1250", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -1605,7 +1605,7 @@ describe('instant validation', () => { .toMatchInlineSnapshot(` "Error: Route "/suspense-in-root/static/missing-suspense-in-parallel-route": Next.js encountered runtime data during the initial render or a navigation. - \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. + \`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: - Use \`generateStaticParams\` to make route params static @@ -1647,7 +1647,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1247", + "code": "E1250", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -1667,7 +1667,7 @@ describe('instant validation', () => { .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. - \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. + \`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: - Use \`generateStaticParams\` to make route params static @@ -1709,7 +1709,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1247", + "code": "E1250", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -1729,7 +1729,7 @@ describe('instant validation', () => { .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. - \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. + \`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: - Use \`generateStaticParams\` to make route params static @@ -2580,7 +2580,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1247", + "code": "E1250", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -2600,7 +2600,7 @@ describe('instant validation', () => { .toMatchInlineSnapshot(` "Error: Route "/suspense-in-root/static/route-group-config-only": Next.js encountered runtime data during the initial render or a navigation. - \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. + \`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: - Use \`generateStaticParams\` to make route params static @@ -2641,7 +2641,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1247", + "code": "E1250", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -2661,7 +2661,7 @@ describe('instant validation', () => { .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. - \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. + \`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: - Use \`generateStaticParams\` to make route params static @@ -2703,7 +2703,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1247", + "code": "E1250", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -2723,7 +2723,7 @@ describe('instant validation', () => { .toMatchInlineSnapshot(` "Error: Route "/suspense-in-root/static/route-group-segment-config-only": Next.js encountered runtime data during the initial render or a navigation. - \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. + \`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: - Use \`generateStaticParams\` to make route params static @@ -2765,7 +2765,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1247", + "code": "E1250", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -2785,7 +2785,7 @@ describe('instant validation', () => { .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. - \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. + \`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: - Use \`generateStaticParams\` to make route params static @@ -2827,7 +2827,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1247", + "code": "E1250", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -2847,7 +2847,7 @@ describe('instant validation', () => { .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. - \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. + \`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: - Use \`generateStaticParams\` to make route params static @@ -2896,7 +2896,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1247", + "code": "E1250", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -2916,7 +2916,7 @@ describe('instant validation', () => { .toMatchInlineSnapshot(` "Error: Route "/suspense-in-root/static/route-group-shared-boundary": Next.js encountered runtime data during the initial render or a navigation. - \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. + \`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: - Use \`generateStaticParams\` to make route params static @@ -2972,7 +2972,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1247", + "code": "E1250", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -2992,7 +2992,7 @@ describe('instant validation', () => { .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. - \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. + \`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: - Use \`generateStaticParams\` to make route params static @@ -3042,7 +3042,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1247", + "code": "E1250", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -3062,7 +3062,7 @@ describe('instant validation', () => { .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. - \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. + \`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: - Use \`generateStaticParams\` to make route params static @@ -3113,7 +3113,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1247", + "code": "E1250", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -3133,7 +3133,7 @@ describe('instant validation', () => { .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. - \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. + \`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: - Use \`generateStaticParams\` to make route params static @@ -3181,7 +3181,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1247", + "code": "E1250", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -3232,7 +3232,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1247", + "code": "E1250", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -3252,7 +3252,7 @@ describe('instant validation', () => { .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. - \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. + \`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: - Use \`generateStaticParams\` to make route params static @@ -3296,7 +3296,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1247", + "code": "E1250", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -3316,7 +3316,7 @@ describe('instant validation', () => { .toMatchInlineSnapshot(` "Error: Route "/suspense-in-root/static/config-children-preferred": Next.js encountered runtime data during the initial render or a navigation. - \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed under \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. + \`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: - Use \`generateStaticParams\` to make route params static @@ -3361,7 +3361,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1247", + "code": "E1250", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -3412,11 +3412,11 @@ describe('instant validation', () => { ) await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1246", + "code": "E1248", "description": "Could not validate instant UI because an expected segment was not rendered. Unrendered segment: - app/suspense-in-root/static/multi-depth-deferred-fallback/inner/page.tsx +app/suspense-in-root/static/multi-depth-deferred-fallback/inner/page.tsx Route: /suspense-in-root/static/multi-depth-deferred-fallback/inner @@ -3476,11 +3476,11 @@ describe('instant validation', () => { ) await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1246", + "code": "E1248", "description": "Could not validate instant UI because an expected segment was not rendered. Unrendered segment: - app/suspense-in-root/static/test-firstmod/inter/layout.tsx +app/suspense-in-root/static/test-firstmod/inter/layout.tsx Route: /suspense-in-root/static/test-firstmod/inter/inner @@ -3538,12 +3538,12 @@ describe('instant validation', () => { ) await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1246", + "code": "E1248", "description": "Could not validate instant UI because an expected segment was not rendered. Unrendered segments: - app/suspense-in-root/static/test-multi-unrendered/@sidebar/page.tsx - app/suspense-in-root/static/test-multi-unrendered/page.tsx +app/suspense-in-root/static/test-multi-unrendered/@sidebar/page.tsx +app/suspense-in-root/static/test-multi-unrendered/page.tsx Route: /suspense-in-root/static/test-multi-unrendered @@ -3648,7 +3648,7 @@ describe('instant validation', () => { .toMatchInlineSnapshot(` "Error: Route "/suspense-in-root/disable-validation/disable-dev": Next.js encountered uncached data during the initial render or a navigation. - \`fetch(...)\` or \`connection()\` accessed under \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. + \`fetch(...)\` or \`connection()\` 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: - Cache the data access with \`"use cache"\` @@ -3688,7 +3688,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1246", + "code": "E1249", "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", From 1b2e9c545cf766706f11e14faa366984c136db7c Mon Sep 17 00:00:00 2001 From: Aurora Scharff Date: Fri, 15 May 2026 00:03:39 +0200 Subject: [PATCH 12/34] Use state.page for clear-on-nav + update unit tests - Drop history.pushState/replaceState patching in favor of state.page from ACTION_DEVTOOL_UPDATE_ROUTE_STATE (cooperates with App Router's own history patching). - Update errors.test.ts for new {inNavigation, variant: 'dynamic'} shape and add InNavigation factory cases. - Bump E1246/E1247 -> E1249/E1250 in level-* and causes tests after the factory wording change. Co-authored-by: Cursor --- .../dev-overlay/container/errors.test.ts | 56 ++++++++++++++----- .../next-devtools/dev-overlay/dev-overlay.tsx | 37 +++--------- .../instant-validation-causes.test.ts | 8 +-- .../instant-validation-level-error.test.ts | 10 ++-- ...tant-validation-level-manual-error.test.ts | 6 +- ...nt-validation-level-manual-warning.test.ts | 12 ++-- .../instant-validation-level-warning.test.ts | 10 ++-- 7 files changed, 72 insertions(+), 67 deletions(-) diff --git a/packages/next/src/next-devtools/dev-overlay/container/errors.test.ts b/packages/next/src/next-devtools/dev-overlay/container/errors.test.ts index dae0dfdfcfb8..7826dfcd710f 100644 --- a/packages/next/src/next-devtools/dev-overlay/container/errors.test.ts +++ b/packages/next/src/next-devtools/dev-overlay/container/errors.test.ts @@ -1,11 +1,13 @@ import { createDynamicBodyError, + createDynamicBodyErrorInNavigation, createDynamicMetadataError, createDynamicOrRuntimeBodyError, createDynamicOrRuntimeMetadataError, createDynamicOrRuntimeViewportError, createDynamicViewportError, createRuntimeBodyError, + createRuntimeBodyErrorInNavigation, createRuntimeMetadataError, createRuntimeViewportError, } from '../../../server/app-render/blocking-route-messages' @@ -128,24 +130,48 @@ describe('isSyncIOClientError', () => { }) describe('getBlockingRouteErrorDetails', () => { - it('classifies createRuntimeBodyError as blocking-route + runtime', () => { + it('classifies createRuntimeBodyError as blocking-route + runtime (SSR-only)', () => { expect(getBlockingRouteErrorDetails(createRuntimeBodyError(ROUTE))).toEqual( - { type: 'blocking-route', variant: 'runtime' } + { type: 'blocking-route', variant: 'runtime', inNavigation: false } ) }) - it('classifies createDynamicBodyError as blocking-route + navigation', () => { + it('classifies createDynamicBodyError as blocking-route + dynamic (SSR-only)', () => { expect(getBlockingRouteErrorDetails(createDynamicBodyError(ROUTE))).toEqual( - { type: 'blocking-route', variant: 'navigation' } + { type: 'blocking-route', variant: 'dynamic', inNavigation: false } ) }) - it('classifies createDynamicOrRuntimeBodyError as blocking-route + navigation', () => { + it('classifies createRuntimeBodyErrorInNavigation as blocking-route + runtime + inNavigation', () => { + expect( + getBlockingRouteErrorDetails(createRuntimeBodyErrorInNavigation(ROUTE)) + ).toEqual({ + type: 'blocking-route', + variant: 'runtime', + inNavigation: true, + }) + }) + + it('classifies createDynamicBodyErrorInNavigation as blocking-route + dynamic + inNavigation', () => { + expect( + getBlockingRouteErrorDetails(createDynamicBodyErrorInNavigation(ROUTE)) + ).toEqual({ + type: 'blocking-route', + variant: 'dynamic', + inNavigation: true, + }) + }) + + it('classifies createDynamicOrRuntimeBodyError as blocking-route + dynamic (SSR-only)', () => { // The "either" factory has no clear runtime signal — falls into the - // navigation branch by `isRuntimeVariant`. Documents current behavior. + // dynamic branch by `isRuntimeVariant`. Documents current behavior. expect( getBlockingRouteErrorDetails(createDynamicOrRuntimeBodyError(ROUTE)) - ).toEqual({ type: 'blocking-route', variant: 'navigation' }) + ).toEqual({ + type: 'blocking-route', + variant: 'dynamic', + inNavigation: false, + }) }) it('classifies createRuntimeMetadataError as dynamic-metadata + runtime', () => { @@ -154,16 +180,16 @@ describe('getBlockingRouteErrorDetails', () => { ).toEqual({ type: 'dynamic-metadata', variant: 'runtime' }) }) - it('classifies createDynamicMetadataError as dynamic-metadata + navigation', () => { + it('classifies createDynamicMetadataError as dynamic-metadata + dynamic', () => { expect( getBlockingRouteErrorDetails(createDynamicMetadataError(ROUTE)) - ).toEqual({ type: 'dynamic-metadata', variant: 'navigation' }) + ).toEqual({ type: 'dynamic-metadata', variant: 'dynamic' }) }) - it('classifies createDynamicOrRuntimeMetadataError as dynamic-metadata + navigation', () => { + it('classifies createDynamicOrRuntimeMetadataError as dynamic-metadata + dynamic', () => { expect( getBlockingRouteErrorDetails(createDynamicOrRuntimeMetadataError(ROUTE)) - ).toEqual({ type: 'dynamic-metadata', variant: 'navigation' }) + ).toEqual({ type: 'dynamic-metadata', variant: 'dynamic' }) }) it('classifies createRuntimeViewportError as dynamic-viewport + runtime', () => { @@ -172,16 +198,16 @@ describe('getBlockingRouteErrorDetails', () => { ).toEqual({ type: 'dynamic-viewport', variant: 'runtime' }) }) - it('classifies createDynamicViewportError as dynamic-viewport + navigation', () => { + it('classifies createDynamicViewportError as dynamic-viewport + dynamic', () => { expect( getBlockingRouteErrorDetails(createDynamicViewportError(ROUTE)) - ).toEqual({ type: 'dynamic-viewport', variant: 'navigation' }) + ).toEqual({ type: 'dynamic-viewport', variant: 'dynamic' }) }) - it('classifies createDynamicOrRuntimeViewportError as dynamic-viewport + navigation', () => { + it('classifies createDynamicOrRuntimeViewportError as dynamic-viewport + dynamic', () => { expect( getBlockingRouteErrorDetails(createDynamicOrRuntimeViewportError(ROUTE)) - ).toEqual({ type: 'dynamic-viewport', variant: 'navigation' }) + ).toEqual({ type: 'dynamic-viewport', variant: 'dynamic' }) }) it.each<[SyncIOApiType, string, string]>([ diff --git a/packages/next/src/next-devtools/dev-overlay/dev-overlay.tsx b/packages/next/src/next-devtools/dev-overlay/dev-overlay.tsx index cac1bacf1741..c1578070a759 100644 --- a/packages/next/src/next-devtools/dev-overlay/dev-overlay.tsx +++ b/packages/next/src/next-devtools/dev-overlay/dev-overlay.tsx @@ -18,38 +18,17 @@ export const RenderErrorContext = createContext<{ export const useRenderErrorContext = () => useContext(RenderErrorContext) -// `usePathname()` is unavailable here — the overlay is in its own React root -// outside the App Router context. Listen to history events directly. function useClearInstantErrorsOnNav( + page: string, dispatch: (action: DispatcherEvent) => void ) { + const previousPageRef = useRef(page) useEffect(() => { - let previousPath = window.location.pathname - const fireIfChanged = () => { - const currentPath = window.location.pathname - if (currentPath === previousPath) return - previousPath = currentPath - dispatch({ type: ACTION_INSTANT_ERRORS_CLEAR, currentPath }) - } - - window.addEventListener('popstate', fireIfChanged) - const originalPushState = history.pushState - const originalReplaceState = history.replaceState - history.pushState = function (...args) { - originalPushState.apply(this, args) - fireIfChanged() - } - history.replaceState = function (...args) { - originalReplaceState.apply(this, args) - fireIfChanged() - } - - return () => { - window.removeEventListener('popstate', fireIfChanged) - history.pushState = originalPushState - history.replaceState = originalReplaceState - } - }, [dispatch]) + const previousPage = previousPageRef.current + previousPageRef.current = page + if (page === '' || page === previousPage) return + dispatch({ type: ACTION_INSTANT_ERRORS_CLEAR, currentPath: page }) + }, [page, dispatch]) } export function DevOverlay() { @@ -60,7 +39,7 @@ export function DevOverlay() { state.instantNavs ? 'instant-navs' : null ) - useClearInstantErrorsOnNav(dispatch) + useClearInstantErrorsOnNav(state.page, dispatch) const triggerRef = useRef(null) return ( 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 be2fc1ff29b5..a60d07da1f31 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": "E1247", + "code": "E1250", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -136,7 +136,7 @@ describe('instant validation causes', () => { ], }, ], - "code": "E1247", + "code": "E1250", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -167,7 +167,7 @@ describe('instant validation causes', () => { ], }, ], - "code": "E1247", + "code": "E1250", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -201,7 +201,7 @@ describe('instant validation causes', () => { ], }, ], - "code": "E1247", + "code": "E1250", "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 e4d0aa3e2730..d45d337d2b63 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": "E1246", + "code": "E1249", "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -90,7 +90,7 @@ describe('instant validation - level error', () => { ], }, ], - "code": "E1246", + "code": "E1249", "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -120,7 +120,7 @@ describe('instant validation - level error', () => { ], }, ], - "code": "E1246", + "code": "E1249", "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -150,7 +150,7 @@ describe('instant validation - level error', () => { ], }, ], - "code": "E1246", + "code": "E1249", "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": "E1246", + "code": "E1249", "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", 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 d643de065f0d..3ebb4a6946ea 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": "E1246", + "code": "E1249", "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -109,7 +109,7 @@ describe('instant validation - level manual-error', () => { ], }, ], - "code": "E1246", + "code": "E1249", "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -139,7 +139,7 @@ describe('instant validation - level manual-error', () => { ], }, ], - "code": "E1246", + "code": "E1249", "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", 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 e88234392c65..599d66b0144e 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,8 +93,8 @@ describe('instant validation - level manual-warning', () => { ], }, ], - "code": "E1246", - "description": "Next.js encountered uncached data during a navigation.", + "code": "E1249", + "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/with-root-suspense/explicit-error/page.tsx (11:19) @ Page @@ -125,8 +125,8 @@ describe('instant validation - level manual-warning', () => { ], }, ], - "code": "E1246", - "description": "Next.js encountered uncached data during a navigation.", + "code": "E1249", + "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/with-root-suspense/explicit-true/page.tsx (10:19) @ Page @@ -157,8 +157,8 @@ describe('instant validation - level manual-warning', () => { ], }, ], - "code": "E1246", - "description": "Next.js encountered uncached data during a navigation.", + "code": "E1249", + "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/with-root-suspense/explicit-warning/page.tsx (9:19) @ Page 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 3cc501d521ea..27d43e3f422a 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": "E1246", + "code": "E1249", "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -90,7 +90,7 @@ describe('instant validation - level warning', () => { ], }, ], - "code": "E1246", + "code": "E1249", "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -120,7 +120,7 @@ describe('instant validation - level warning', () => { ], }, ], - "code": "E1246", + "code": "E1249", "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -150,7 +150,7 @@ describe('instant validation - level warning', () => { ], }, ], - "code": "E1246", + "code": "E1249", "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": "E1246", + "code": "E1249", "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", From bb7fa350e877edfac4556c3d618def2104b05447 Mon Sep 17 00:00:00 2001 From: Aurora Scharff Date: Fri, 15 May 2026 00:15:30 +0200 Subject: [PATCH 13/34] Fix snapshot indentation and drop test/tmp prefix - Restore the 13-space indent on `Unrendered segment(s):` paths in dev inline snapshots (got stripped during the earlier wording sweep). - Use the stable `app/...` prefix instead of the non-deterministic `test/tmp/next-test--/...` path that crept into one parallel-slots snapshot. Co-authored-by: Cursor --- .../instant-validation-parallel-slots.test.ts | 2 +- .../app-dir/instant-validation/instant-validation.test.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) 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 44b069fba961..a12fa7c4a9a3 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 @@ -587,7 +587,7 @@ describe('instant validation - parallel slot configs', () => { "description": "Could not validate instant UI because an expected segment was not rendered. Unrendered segment: - test/tmp/next-test-1778789286151-152/app/suspense-in-root/parallel/conditional-breadcrumbs/show-only-breadcrumbs/unblocked/page.tsx + app/suspense-in-root/parallel/conditional-breadcrumbs/show-only-breadcrumbs/unblocked/page.tsx Route: /suspense-in-root/parallel/conditional-breadcrumbs/show-only-breadcrumbs/unblocked 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 1ef6ad4819cb..c83addd84e20 100644 --- a/test/e2e/app-dir/instant-validation/instant-validation.test.ts +++ b/test/e2e/app-dir/instant-validation/instant-validation.test.ts @@ -3416,7 +3416,7 @@ describe('instant validation', () => { "description": "Could not validate instant UI because an expected segment was not rendered. Unrendered segment: -app/suspense-in-root/static/multi-depth-deferred-fallback/inner/page.tsx + app/suspense-in-root/static/multi-depth-deferred-fallback/inner/page.tsx Route: /suspense-in-root/static/multi-depth-deferred-fallback/inner @@ -3480,7 +3480,7 @@ app/suspense-in-root/static/multi-depth-deferred-fallback/inner/page.tsx "description": "Could not validate instant UI because an expected segment was not rendered. Unrendered segment: -app/suspense-in-root/static/test-firstmod/inter/layout.tsx + app/suspense-in-root/static/test-firstmod/inter/layout.tsx Route: /suspense-in-root/static/test-firstmod/inter/inner @@ -3542,8 +3542,8 @@ app/suspense-in-root/static/test-firstmod/inter/layout.tsx "description": "Could not validate instant UI because an expected segment was not rendered. Unrendered segments: -app/suspense-in-root/static/test-multi-unrendered/@sidebar/page.tsx -app/suspense-in-root/static/test-multi-unrendered/page.tsx + app/suspense-in-root/static/test-multi-unrendered/@sidebar/page.tsx + app/suspense-in-root/static/test-multi-unrendered/page.tsx Route: /suspense-in-root/static/test-multi-unrendered From aa2d6ef25869356a7f73da2b51c188a23be97b80 Mon Sep 17 00:00:00 2001 From: Aurora Scharff Date: Fri, 15 May 2026 00:29:32 +0200 Subject: [PATCH 14/34] Skip first state.page transition when clearing instant errors on nav MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `state.page` is the resolved URL (e.g. `/foo/123`), but an instant error's embedded `Route "..."` uses the route pattern (`/foo/[param]`). Firing the clear action on the initial '' → page transition would always wipe dynamic-route errors before the redbox could open. Treat the first non-empty page as the baseline and only dispatch on subsequent changes. Co-authored-by: Cursor --- .../src/next-devtools/dev-overlay/dev-overlay.tsx | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/next/src/next-devtools/dev-overlay/dev-overlay.tsx b/packages/next/src/next-devtools/dev-overlay/dev-overlay.tsx index c1578070a759..ce5d42b13436 100644 --- a/packages/next/src/next-devtools/dev-overlay/dev-overlay.tsx +++ b/packages/next/src/next-devtools/dev-overlay/dev-overlay.tsx @@ -18,15 +18,22 @@ export const RenderErrorContext = createContext<{ export const useRenderErrorContext = () => useContext(RenderErrorContext) +// Dispatches `ACTION_INSTANT_ERRORS_CLEAR` whenever the page changes to a +// new non-empty value. The first non-empty value is recorded as a baseline +// (the route the user landed on) and does not trigger a clear. function useClearInstantErrorsOnNav( page: string, dispatch: (action: DispatcherEvent) => void ) { - const previousPageRef = useRef(page) + const baselinePageRef = useRef(null) useEffect(() => { - const previousPage = previousPageRef.current - previousPageRef.current = page - if (page === '' || page === previousPage) return + if (page === '') return + if (baselinePageRef.current === null) { + baselinePageRef.current = page + return + } + if (page === baselinePageRef.current) return + baselinePageRef.current = page dispatch({ type: ACTION_INSTANT_ERRORS_CLEAR, currentPath: page }) }, [page, dispatch]) } From d8449f084bddfb9869f88e136f40734f6554824d Mon Sep 17 00:00:00 2001 From: Aurora Scharff Date: Fri, 15 May 2026 00:41:11 +0200 Subject: [PATCH 15/34] Align runtime-body in-navigation fix-order with the SSR variant MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The SSR `createRuntimeBodyError` lists the Suspense placeholder first (the most general fix) followed by `generateStaticParams`. The in-navigation variant had them flipped, so the top-of-list suggestion was the narrower one (only applies to dynamic-param routes). Reorder the in-nav factory to match SSR, and refresh the build-mode CLI snapshots and the runtime-body in-nav error code (E1250 → E1251). Co-authored-by: Cursor --- packages/next/errors.json | 3 +- .../app-render/blocking-route-messages.ts | 2 +- .../instant-validation-causes.test.ts | 8 +- .../instant-validation-parallel-slots.test.ts | 32 +++---- .../instant-validation.test.ts | 86 +++++++++---------- 5 files changed, 66 insertions(+), 65 deletions(-) diff --git a/packages/next/errors.json b/packages/next/errors.json index 6bbb4f547460..3751e47fbe6b 100644 --- a/packages/next/errors.json +++ b/packages/next/errors.json @@ -1248,5 +1248,6 @@ "1247": "Route \"%s\": Next.js encountered runtime data during the initial render or a navigation.\\n\\n\\`cookies()\\`, \\`headers()\\`, \\`params\\`, or \\`searchParams\\` accessed under \\`\\` 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", "1248": "Could not validate instant UI because an expected segment was not rendered.", "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" + "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" } 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 85695f8ce0df..84801cc7a1d0 100644 --- a/packages/next/src/server/app-render/blocking-route-messages.ts +++ b/packages/next/src/server/app-render/blocking-route-messages.ts @@ -27,8 +27,8 @@ export function createRuntimeBodyErrorInNavigation(route: string): Error { `Route "${route}": 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\n` + `Ways to fix this:\n` + - ` - Use \`generateStaticParams\` to make route params static\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\n` + `Learn more: https://nextjs.org/docs/messages/blocking-route` ) 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 a60d07da1f31..1a9eb517f614 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": "E1250", + "code": "E1251", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -136,7 +136,7 @@ describe('instant validation causes', () => { ], }, ], - "code": "E1250", + "code": "E1251", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -167,7 +167,7 @@ describe('instant validation causes', () => { ], }, ], - "code": "E1250", + "code": "E1251", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -201,7 +201,7 @@ describe('instant validation causes', () => { ], }, ], - "code": "E1250", + "code": "E1251", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", 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 a12fa7c4a9a3..cefa1e09041c 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": "E1250", + "code": "E1251", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -147,8 +147,8 @@ describe('instant validation - parallel slot configs', () => { \`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: - - Use \`generateStaticParams\` to make route params static - Provide a placeholder with \`\` around the data access + - Use \`generateStaticParams\` to make route params static - 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": "E1250", + "code": "E1251", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -207,8 +207,8 @@ describe('instant validation - parallel slot configs', () => { \`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: - - Use \`generateStaticParams\` to make route params static - Provide a placeholder with \`\` around the data access + - Use \`generateStaticParams\` to make route params static - 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": "E1250", + "code": "E1251", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -267,8 +267,8 @@ describe('instant validation - parallel slot configs', () => { \`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: - - Use \`generateStaticParams\` to make route params static - Provide a placeholder with \`\` around the data access + - Use \`generateStaticParams\` to make route params static - 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": "E1250", + "code": "E1251", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -329,8 +329,8 @@ describe('instant validation - parallel slot configs', () => { \`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: - - Use \`generateStaticParams\` to make route params static - Provide a placeholder with \`\` around the data access + - Use \`generateStaticParams\` to make route params static - 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": "E1250", + "code": "E1251", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -392,7 +392,7 @@ describe('instant validation - parallel slot configs', () => { ], }, ], - "code": "E1250", + "code": "E1251", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -416,8 +416,8 @@ describe('instant validation - parallel slot configs', () => { \`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: - - Use \`generateStaticParams\` to make route params static - Provide a placeholder with \`\` around the data access + - Use \`generateStaticParams\` to make route params static - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -430,8 +430,8 @@ describe('instant validation - parallel slot configs', () => { \`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: - - Use \`generateStaticParams\` to make route params static - Provide a placeholder with \`\` around the data access + - Use \`generateStaticParams\` to make route params static - 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": "E1250", + "code": "E1251", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -556,8 +556,8 @@ describe('instant validation - parallel slot configs', () => { \`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: - - Use \`generateStaticParams\` to make route params static - Provide a placeholder with \`\` around the data access + - Use \`generateStaticParams\` to make route params static - 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": "E1250", + "code": "E1251", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -671,8 +671,8 @@ describe('instant validation - parallel slot configs', () => { \`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: - - Use \`generateStaticParams\` to make route params static - Provide a placeholder with \`\` around the data access + - Use \`generateStaticParams\` to make route params static - 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 c83addd84e20..9b3def2e15e1 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": "E1250", + "code": "E1251", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -203,8 +203,8 @@ describe('instant validation', () => { \`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: - - Use \`generateStaticParams\` to make route params static - Provide a placeholder with \`\` around the data access + - Use \`generateStaticParams\` to make route params static - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -363,7 +363,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1250", + "code": "E1251", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -386,8 +386,8 @@ describe('instant validation', () => { \`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: - - Use \`generateStaticParams\` to make route params static - Provide a placeholder with \`\` around the data access + - Use \`generateStaticParams\` to make route params static - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -486,7 +486,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1250", + "code": "E1251", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -534,7 +534,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1250", + "code": "E1251", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -557,8 +557,8 @@ describe('instant validation', () => { \`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: - - Use \`generateStaticParams\` to make route params static - Provide a placeholder with \`\` around the data access + - Use \`generateStaticParams\` to make route params static - 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": "E1250", + "code": "E1251", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -652,8 +652,8 @@ describe('instant validation', () => { \`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: - - Use \`generateStaticParams\` to make route params static - Provide a placeholder with \`\` around the data access + - Use \`generateStaticParams\` to make route params static - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -1372,7 +1372,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1250", + "code": "E1251", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -1395,8 +1395,8 @@ describe('instant validation', () => { \`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: - - Use \`generateStaticParams\` to make route params static - Provide a placeholder with \`\` around the data access + - Use \`generateStaticParams\` to make route params static - 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": "E1250", + "code": "E1251", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -1483,8 +1483,8 @@ describe('instant validation', () => { \`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: - - Use \`generateStaticParams\` to make route params static - Provide a placeholder with \`\` around the data access + - Use \`generateStaticParams\` to make route params static - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -1585,7 +1585,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1250", + "code": "E1251", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -1608,8 +1608,8 @@ describe('instant validation', () => { \`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: - - Use \`generateStaticParams\` to make route params static - Provide a placeholder with \`\` around the data access + - Use \`generateStaticParams\` to make route params static - 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": "E1250", + "code": "E1251", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -1670,8 +1670,8 @@ describe('instant validation', () => { \`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: - - Use \`generateStaticParams\` to make route params static - Provide a placeholder with \`\` around the data access + - Use \`generateStaticParams\` to make route params static - 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": "E1250", + "code": "E1251", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -1732,8 +1732,8 @@ describe('instant validation', () => { \`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: - - Use \`generateStaticParams\` to make route params static - Provide a placeholder with \`\` around the data access + - Use \`generateStaticParams\` to make route params static - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -2580,7 +2580,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1250", + "code": "E1251", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -2603,8 +2603,8 @@ describe('instant validation', () => { \`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: - - Use \`generateStaticParams\` to make route params static - Provide a placeholder with \`\` around the data access + - Use \`generateStaticParams\` to make route params static - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -2641,7 +2641,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1250", + "code": "E1251", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -2664,8 +2664,8 @@ describe('instant validation', () => { \`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: - - Use \`generateStaticParams\` to make route params static - Provide a placeholder with \`\` around the data access + - Use \`generateStaticParams\` to make route params static - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -2703,7 +2703,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1250", + "code": "E1251", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -2726,8 +2726,8 @@ describe('instant validation', () => { \`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: - - Use \`generateStaticParams\` to make route params static - Provide a placeholder with \`\` around the data access + - Use \`generateStaticParams\` to make route params static - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -2765,7 +2765,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1250", + "code": "E1251", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -2788,8 +2788,8 @@ describe('instant validation', () => { \`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: - - Use \`generateStaticParams\` to make route params static - Provide a placeholder with \`\` around the data access + - Use \`generateStaticParams\` to make route params static - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -2827,7 +2827,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1250", + "code": "E1251", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -2850,8 +2850,8 @@ describe('instant validation', () => { \`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: - - Use \`generateStaticParams\` to make route params static - Provide a placeholder with \`\` around the data access + - Use \`generateStaticParams\` to make route params static - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -2896,7 +2896,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1250", + "code": "E1251", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -2919,8 +2919,8 @@ describe('instant validation', () => { \`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: - - Use \`generateStaticParams\` to make route params static - Provide a placeholder with \`\` around the data access + - Use \`generateStaticParams\` to make route params static - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -2972,7 +2972,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1250", + "code": "E1251", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -2995,8 +2995,8 @@ describe('instant validation', () => { \`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: - - Use \`generateStaticParams\` to make route params static - Provide a placeholder with \`\` around the data access + - Use \`generateStaticParams\` to make route params static - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -3042,7 +3042,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1250", + "code": "E1251", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -3065,8 +3065,8 @@ describe('instant validation', () => { \`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: - - Use \`generateStaticParams\` to make route params static - Provide a placeholder with \`\` around the data access + - Use \`generateStaticParams\` to make route params static - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -3113,7 +3113,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1250", + "code": "E1251", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -3136,8 +3136,8 @@ describe('instant validation', () => { \`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: - - Use \`generateStaticParams\` to make route params static - Provide a placeholder with \`\` around the data access + - Use \`generateStaticParams\` to make route params static - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -3181,7 +3181,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1250", + "code": "E1251", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -3232,7 +3232,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1250", + "code": "E1251", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -3255,8 +3255,8 @@ describe('instant validation', () => { \`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: - - Use \`generateStaticParams\` to make route params static - Provide a placeholder with \`\` around the data access + - Use \`generateStaticParams\` to make route params static - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -3296,7 +3296,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1250", + "code": "E1251", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -3319,8 +3319,8 @@ describe('instant validation', () => { \`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: - - Use \`generateStaticParams\` to make route params static - Provide a placeholder with \`\` around the data access + - Use \`generateStaticParams\` to make route params static - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -3361,7 +3361,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1250", + "code": "E1251", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", From 4e4406d337221d697d39163946e13a7cebc6d9e6 Mon Sep 17 00:00:00 2001 From: Aurora Scharff Date: Fri, 15 May 2026 00:43:20 +0200 Subject: [PATCH 16/34] Fix `code`/`description` indent in level-* snapshots The earlier wording sweep on the level-* tests preserved the pre-existing 2-space-shy indent on the `code` and `description` lines, so Jest's diff reported a whitespace-only mismatch even though the values agreed. Match them to the sibling JSON keys (13 spaces). Co-authored-by: Cursor --- .../instant-validation-level-error.test.ts | 20 +++++++++---------- ...tant-validation-level-manual-error.test.ts | 12 +++++------ ...nt-validation-level-manual-warning.test.ts | 12 +++++------ .../instant-validation-level-warning.test.ts | 20 +++++++++---------- 4 files changed, 32 insertions(+), 32 deletions(-) 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 d45d337d2b63..fa4f198fe71b 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,8 +60,8 @@ describe('instant validation - level error', () => { const browser = await next.browser('/bare') await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1249", - "description": "Next.js encountered uncached data during a navigation.", + "code": "E1249", + "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/bare/page.tsx (11:19) @ Page @@ -90,8 +90,8 @@ describe('instant validation - level error', () => { ], }, ], - "code": "E1249", - "description": "Next.js encountered uncached data during a navigation.", + "code": "E1249", + "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/explicit-error/page.tsx (11:19) @ Page @@ -120,8 +120,8 @@ describe('instant validation - level error', () => { ], }, ], - "code": "E1249", - "description": "Next.js encountered uncached data during a navigation.", + "code": "E1249", + "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/explicit-true/page.tsx (12:19) @ Page @@ -150,8 +150,8 @@ describe('instant validation - level error', () => { ], }, ], - "code": "E1249", - "description": "Next.js encountered uncached data during a navigation.", + "code": "E1249", + "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/explicit-warning/page.tsx (11:19) @ Page @@ -177,8 +177,8 @@ describe('instant validation - level error', () => { const browser = await next.browser('/layered') await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1249", - "description": "Next.js encountered uncached data during a navigation.", + "code": "E1249", + "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/layered/page.tsx (8:19) @ Page 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 3ebb4a6946ea..fb648acf2d9d 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,8 +79,8 @@ describe('instant validation - level manual-error', () => { ], }, ], - "code": "E1249", - "description": "Next.js encountered uncached data during a navigation.", + "code": "E1249", + "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/explicit-error/page.tsx (11:19) @ Page @@ -109,8 +109,8 @@ describe('instant validation - level manual-error', () => { ], }, ], - "code": "E1249", - "description": "Next.js encountered uncached data during a navigation.", + "code": "E1249", + "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/explicit-true/page.tsx (12:19) @ Page @@ -139,8 +139,8 @@ describe('instant validation - level manual-error', () => { ], }, ], - "code": "E1249", - "description": "Next.js encountered uncached data during a navigation.", + "code": "E1249", + "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/explicit-warning/page.tsx (11:19) @ Page 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 599d66b0144e..37036f306a50 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,8 +93,8 @@ describe('instant validation - level manual-warning', () => { ], }, ], - "code": "E1249", - "description": "Next.js encountered uncached data during a navigation.", + "code": "E1249", + "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/with-root-suspense/explicit-error/page.tsx (11:19) @ Page @@ -125,8 +125,8 @@ describe('instant validation - level manual-warning', () => { ], }, ], - "code": "E1249", - "description": "Next.js encountered uncached data during a navigation.", + "code": "E1249", + "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/with-root-suspense/explicit-true/page.tsx (10:19) @ Page @@ -157,8 +157,8 @@ describe('instant validation - level manual-warning', () => { ], }, ], - "code": "E1249", - "description": "Next.js encountered uncached data during a navigation.", + "code": "E1249", + "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/with-root-suspense/explicit-warning/page.tsx (9:19) @ Page 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 27d43e3f422a..b8ef4a7a7b3c 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,8 +60,8 @@ describe('instant validation - level warning', () => { const browser = await next.browser('/bare') await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1249", - "description": "Next.js encountered uncached data during a navigation.", + "code": "E1249", + "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/bare/page.tsx (10:19) @ Page @@ -90,8 +90,8 @@ describe('instant validation - level warning', () => { ], }, ], - "code": "E1249", - "description": "Next.js encountered uncached data during a navigation.", + "code": "E1249", + "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/explicit-error/page.tsx (10:19) @ Page @@ -120,8 +120,8 @@ describe('instant validation - level warning', () => { ], }, ], - "code": "E1249", - "description": "Next.js encountered uncached data during a navigation.", + "code": "E1249", + "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/explicit-true/page.tsx (11:19) @ Page @@ -150,8 +150,8 @@ describe('instant validation - level warning', () => { ], }, ], - "code": "E1249", - "description": "Next.js encountered uncached data during a navigation.", + "code": "E1249", + "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/explicit-warning/page.tsx (11:19) @ Page @@ -177,8 +177,8 @@ describe('instant validation - level warning', () => { const browser = await next.browser('/layered') await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1249", - "description": "Next.js encountered uncached data during a navigation.", + "code": "E1249", + "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/layered/page.tsx (8:19) @ Page From b1876c8f92d662cd581bc9842b184b8dc82cec79 Mon Sep 17 00:00:00 2001 From: Aurora Scharff Date: Fri, 15 May 2026 00:57:55 +0200 Subject: [PATCH 17/34] Match sibling indent for code/description in remaining level-* snapshots The previous patch overshot to 13 spaces in tests where the snapshot braces sit two columns shallower (so sibling keys are at 11). Auto-align each `code`/`description` line to the indent of the next sibling key. Co-authored-by: Cursor --- .../instant-validation-level-error.test.ts | 20 +++++++++---------- ...tant-validation-level-manual-error.test.ts | 12 +++++------ .../instant-validation-level-warning.test.ts | 20 +++++++++---------- 3 files changed, 26 insertions(+), 26 deletions(-) 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 fa4f198fe71b..d45d337d2b63 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,8 +60,8 @@ describe('instant validation - level error', () => { const browser = await next.browser('/bare') await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1249", - "description": "Next.js encountered uncached data during a navigation.", + "code": "E1249", + "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/bare/page.tsx (11:19) @ Page @@ -90,8 +90,8 @@ describe('instant validation - level error', () => { ], }, ], - "code": "E1249", - "description": "Next.js encountered uncached data during a navigation.", + "code": "E1249", + "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/explicit-error/page.tsx (11:19) @ Page @@ -120,8 +120,8 @@ describe('instant validation - level error', () => { ], }, ], - "code": "E1249", - "description": "Next.js encountered uncached data during a navigation.", + "code": "E1249", + "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/explicit-true/page.tsx (12:19) @ Page @@ -150,8 +150,8 @@ describe('instant validation - level error', () => { ], }, ], - "code": "E1249", - "description": "Next.js encountered uncached data during a navigation.", + "code": "E1249", + "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/explicit-warning/page.tsx (11:19) @ Page @@ -177,8 +177,8 @@ describe('instant validation - level error', () => { const browser = await next.browser('/layered') await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1249", - "description": "Next.js encountered uncached data during a navigation.", + "code": "E1249", + "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/layered/page.tsx (8:19) @ Page 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 fb648acf2d9d..3ebb4a6946ea 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,8 +79,8 @@ describe('instant validation - level manual-error', () => { ], }, ], - "code": "E1249", - "description": "Next.js encountered uncached data during a navigation.", + "code": "E1249", + "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/explicit-error/page.tsx (11:19) @ Page @@ -109,8 +109,8 @@ describe('instant validation - level manual-error', () => { ], }, ], - "code": "E1249", - "description": "Next.js encountered uncached data during a navigation.", + "code": "E1249", + "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/explicit-true/page.tsx (12:19) @ Page @@ -139,8 +139,8 @@ describe('instant validation - level manual-error', () => { ], }, ], - "code": "E1249", - "description": "Next.js encountered uncached data during a navigation.", + "code": "E1249", + "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/explicit-warning/page.tsx (11:19) @ Page 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 b8ef4a7a7b3c..27d43e3f422a 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,8 +60,8 @@ describe('instant validation - level warning', () => { const browser = await next.browser('/bare') await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1249", - "description": "Next.js encountered uncached data during a navigation.", + "code": "E1249", + "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/bare/page.tsx (10:19) @ Page @@ -90,8 +90,8 @@ describe('instant validation - level warning', () => { ], }, ], - "code": "E1249", - "description": "Next.js encountered uncached data during a navigation.", + "code": "E1249", + "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/explicit-error/page.tsx (10:19) @ Page @@ -120,8 +120,8 @@ describe('instant validation - level warning', () => { ], }, ], - "code": "E1249", - "description": "Next.js encountered uncached data during a navigation.", + "code": "E1249", + "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/explicit-true/page.tsx (11:19) @ Page @@ -150,8 +150,8 @@ describe('instant validation - level warning', () => { ], }, ], - "code": "E1249", - "description": "Next.js encountered uncached data during a navigation.", + "code": "E1249", + "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/explicit-warning/page.tsx (11:19) @ Page @@ -177,8 +177,8 @@ describe('instant validation - level warning', () => { const browser = await next.browser('/layered') await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1249", - "description": "Next.js encountered uncached data during a navigation.", + "code": "E1249", + "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/layered/page.tsx (8:19) @ Page From 2b32f5de47712ab42b9413d471335c38d1a6fe8f Mon Sep 17 00:00:00 2001 From: Aurora Scharff Date: Fri, 15 May 2026 01:08:16 +0200 Subject: [PATCH 18/34] Update build-mode CLI snapshots for in-navigation factory wording `trackDynamicHoleInNavigation` is also reached during the build-time prerender pass, so the CLI build error now reads "during the initial render or a navigation" with the matching consequence clause. Update the build-mode snapshots in `instant-validation-build` and the four `instant-validation-level-*` tests to match. Co-authored-by: Cursor --- .../instant-validation-build.test.ts | 4 +-- .../instant-validation-level-error.test.ts | 16 +++++------ ...tant-validation-level-manual-error.test.ts | 8 +++--- ...nt-validation-level-manual-warning.test.ts | 28 +++++++++---------- .../instant-validation-level-warning.test.ts | 4 +-- 5 files changed, 30 insertions(+), 30 deletions(-) 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 b776555f0046..13f2f996118a 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,9 +63,9 @@ 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. + "Error: Route "/invalid-missing-suspense-around-runtime": Next.js encountered uncached data during the initial render or a navigation. - \`fetch(...)\` or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`fetch(...)\` or \`connection()\` 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: - Cache the data access with \`"use cache"\` 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 d45d337d2b63..ac346f83eb96 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 @@ -197,9 +197,9 @@ 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. + "Error: Route "/bare": Next.js encountered uncached data during the initial render or a navigation. - \`fetch(...)\` or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`fetch(...)\` or \`connection()\` 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: - Cache the data access with \`"use cache"\` @@ -223,9 +223,9 @@ 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. + "Error: Route "/explicit-error": Next.js encountered uncached data during the initial render or a navigation. - \`fetch(...)\` or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`fetch(...)\` or \`connection()\` 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: - Cache the data access with \`"use cache"\` @@ -249,9 +249,9 @@ 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. + "Error: Route "/explicit-true": Next.js encountered uncached data during the initial render or a navigation. - \`fetch(...)\` or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`fetch(...)\` or \`connection()\` 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: - Cache the data access with \`"use cache"\` @@ -288,9 +288,9 @@ 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. + "Error: Route "/layered": Next.js encountered uncached data during the initial render or a navigation. - \`fetch(...)\` or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`fetch(...)\` or \`connection()\` 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: - Cache the data access with \`"use cache"\` 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 3ebb4a6946ea..74f9e9fdb444 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 @@ -180,9 +180,9 @@ 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. + "Error: Route "/explicit-error": Next.js encountered uncached data during the initial render or a navigation. - \`fetch(...)\` or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`fetch(...)\` or \`connection()\` 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: - Cache the data access with \`"use cache"\` @@ -206,9 +206,9 @@ 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. + "Error: Route "/explicit-true": Next.js encountered uncached data during the initial render or a navigation. - \`fetch(...)\` or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`fetch(...)\` or \`connection()\` 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: - Cache the data access with \`"use cache"\` 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 37036f306a50..daa816103697 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 @@ -192,9 +192,9 @@ 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. + "Error: Route "/with-root-suspense/explicit-error": Next.js encountered uncached data during the initial render or a navigation. - \`fetch(...)\` or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`fetch(...)\` or \`connection()\` 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: - Cache the data access with \`"use cache"\` @@ -230,7 +230,7 @@ describe('instant validation - level manual-warning', () => { await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1220", - "description": "Next.js encountered uncached data during the initial render.", + "description": "Next.js encountered uncached data during the initial render or a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/without-root-suspense/bare/page.tsx (10:19) @ Page @@ -250,7 +250,7 @@ describe('instant validation - level manual-warning', () => { await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1220", - "description": "Next.js encountered uncached data during the initial render.", + "description": "Next.js encountered uncached data during the initial render or a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/without-root-suspense/explicit-error/page.tsx (11:19) @ Page @@ -270,7 +270,7 @@ describe('instant validation - level manual-warning', () => { await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1220", - "description": "Next.js encountered uncached data during the initial render.", + "description": "Next.js encountered uncached data during the initial render or a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/without-root-suspense/explicit-true/page.tsx (11:19) @ Page @@ -290,7 +290,7 @@ describe('instant validation - level manual-warning', () => { await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1220", - "description": "Next.js encountered uncached data during the initial render.", + "description": "Next.js encountered uncached data during the initial render or a navigation.", "environmentLabel": "Server", "label": "Instant", "source": "app/without-root-suspense/explicit-warning/page.tsx (10:19) @ Page @@ -330,9 +330,9 @@ 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 the initial render or a navigation. - \`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 or the navigation from being instant, leading to a slower user experience. Ways to fix this: - Cache the data access with \`"use cache"\` @@ -356,9 +356,9 @@ 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 the initial render or a navigation. - \`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 or the navigation from being instant, leading to a slower user experience. Ways to fix this: - Cache the data access with \`"use cache"\` @@ -384,9 +384,9 @@ 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 the initial render or a navigation. - \`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 or the navigation from being instant, leading to a slower user experience. Ways to fix this: - Cache the data access with \`"use cache"\` @@ -416,9 +416,9 @@ 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 the initial render or a navigation. - \`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 or the navigation from being instant, leading to a slower user experience. Ways to fix this: - Cache the data access with \`"use cache"\` 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 27d43e3f422a..d3db682bad6a 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 @@ -202,9 +202,9 @@ 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. + "Error: Route "/explicit-error": Next.js encountered uncached data during the initial render or a navigation. - \`fetch(...)\` or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking navigation and leading to a slower user experience. + \`fetch(...)\` or \`connection()\` 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: - Cache the data access with \`"use cache"\` From e69e4ad3f227fe0816868226c8d3a6f64b850ee3 Mon Sep 17 00:00:00 2001 From: Aurora Scharff Date: Fri, 15 May 2026 01:24:13 +0200 Subject: [PATCH 19/34] Revert SSR-only snapshots in level-manual-warning to initial-render wording The earlier wording sweep also touched the 4 \`without-root-suspense\` E1220 snapshots, which come from the SSR factory (initial-render path) and should keep "during the initial render." Restore the SSR wording on those four. Co-authored-by: Cursor --- .../instant-validation-level-manual-warning.test.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 daa816103697..afa8f609ab97 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 @@ -230,7 +230,7 @@ describe('instant validation - level manual-warning', () => { await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1220", - "description": "Next.js encountered uncached data during the initial render or a navigation.", + "description": "Next.js encountered uncached data during the initial render.", "environmentLabel": "Server", "label": "Instant", "source": "app/without-root-suspense/bare/page.tsx (10:19) @ Page @@ -250,7 +250,7 @@ describe('instant validation - level manual-warning', () => { await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1220", - "description": "Next.js encountered uncached data during the initial render or a navigation.", + "description": "Next.js encountered uncached data during the initial render.", "environmentLabel": "Server", "label": "Instant", "source": "app/without-root-suspense/explicit-error/page.tsx (11:19) @ Page @@ -270,7 +270,7 @@ describe('instant validation - level manual-warning', () => { await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1220", - "description": "Next.js encountered uncached data during the initial render or a navigation.", + "description": "Next.js encountered uncached data during the initial render.", "environmentLabel": "Server", "label": "Instant", "source": "app/without-root-suspense/explicit-true/page.tsx (11:19) @ Page @@ -290,7 +290,7 @@ describe('instant validation - level manual-warning', () => { await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1220", - "description": "Next.js encountered uncached data during the initial render or a navigation.", + "description": "Next.js encountered uncached data during the initial render.", "environmentLabel": "Server", "label": "Instant", "source": "app/without-root-suspense/explicit-warning/page.tsx (10:19) @ Page From e7b2f5b6151a5cfc2290a42cc331135367f5607a Mon Sep 17 00:00:00 2001 From: Aurora Scharff Date: Fri, 15 May 2026 11:18:48 +0200 Subject: [PATCH 20/34] fix failing tests --- ...stant-validation-level-manual-warning.test.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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 afa8f609ab97..7ca9596bed3a 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 @@ -330,9 +330,9 @@ 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 or a navigation. + "Error: Route "/without-root-suspense/bare": Next.js encountered uncached or runtime data during the initial render. - \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. + \`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. Ways to fix this: - Cache the data access with \`"use cache"\` @@ -356,9 +356,9 @@ 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 or a navigation. + "Error: Route "/without-root-suspense/explicit-true": Next.js encountered uncached or runtime data during the initial render. - \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. + \`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. Ways to fix this: - Cache the data access with \`"use cache"\` @@ -384,9 +384,9 @@ 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 or a navigation. + "Error: Route "/without-root-suspense/explicit-warning": Next.js encountered uncached or runtime data during the initial render. - \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. + \`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. Ways to fix this: - Cache the data access with \`"use cache"\` @@ -416,9 +416,9 @@ 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 or a navigation. + "Error: Route "/without-root-suspense/explicit-error": Next.js encountered uncached or runtime data during the initial render. - \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience. + \`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. Ways to fix this: - Cache the data access with \`"use cache"\` From 08f62f97f473597778e15014d999baeb99cc8215 Mon Sep 17 00:00:00 2001 From: Aurora Scharff Date: Fri, 15 May 2026 13:06:58 +0200 Subject: [PATCH 21/34] Handle instant errors more cleanly --- .../dev-overlay/container/errors.tsx | 14 +++++++++++++- .../next/src/next-devtools/dev-overlay/shared.ts | 16 +++++++--------- 2 files changed, 20 insertions(+), 10 deletions(-) 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 775781edb656..c6e637b8cc31 100644 --- a/packages/next/src/next-devtools/dev-overlay/container/errors.tsx +++ b/packages/next/src/next-devtools/dev-overlay/container/errors.tsx @@ -26,7 +26,6 @@ import { type GuidanceVariant, } from '../components/instant/instant-guidance' import { BLOCKING_ROUTE_NAVIGATION_EXPLANATION } from '../components/instant/instant-guidance-data' -import { isBlockingRouteInNavError } from '../shared' import { CodeFrame } from '../components/code-frame/code-frame' import { ErrorOverlayCallStack } from '../components/errors/error-overlay-call-stack/error-overlay-call-stack' import { ErrorCause } from './runtime-error/error-cause' @@ -317,6 +316,19 @@ export function isSyncIOClientError(message: string): boolean { return match !== null && match[2] === '-client' } +// 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 +// `trackDynamicHoleInNavigation` / `getNavigationDisallowedDynamicReasons`. +export function isBlockingRouteInNavError(message: string): boolean { + return ( + message.includes('or a navigation') || + message.includes('Could not validate `unstable_instant`') || + message.includes('Could not validate instant UI') + ) +} + export function getBlockingRouteErrorDetails( error: Error ): null | ErrorDetails { diff --git a/packages/next/src/next-devtools/dev-overlay/shared.ts b/packages/next/src/next-devtools/dev-overlay/shared.ts index 6782e67cfd67..6012cce07653 100644 --- a/packages/next/src/next-devtools/dev-overlay/shared.ts +++ b/packages/next/src/next-devtools/dev-overlay/shared.ts @@ -9,6 +9,7 @@ import { parseStack } from '../../server/lib/parse-stack' import { isConsoleError } from '../shared/console-error' import type { CacheIndicatorState } from './cache-indicator' import { readInstantNavCookieState } from './components/instant-navs/instant-nav-cookie' +import { isBlockingRouteInNavError } from './container/errors' export type DevToolsConfig = { theme?: 'light' | 'dark' | 'system' @@ -281,20 +282,17 @@ function getStackIgnoringStrictMode(stack: string | undefined) { return stack?.split(REACT_ERROR_STACK_BOTTOM_FRAME_REGEX)[0] } -// Detects errors from `createRuntimeBodyErrorInNavigation` / -// `createDynamicBodyErrorInNavigation`. SSR-only factories say "during the -// initial render"; nav factories say "during the initial render or a navigation". -export function isBlockingRouteInNavError(message: string): boolean { - return message.includes('or a navigation') -} - function getInstantErrorRoute(error: unknown): string | null { if (!error || typeof error !== 'object') return null const message = (error as Error).message if (typeof message !== 'string') return null if (!isBlockingRouteInNavError(message)) return null - const match = /^Route "([^"]+)":/.exec(message) - return match ? match[1] : null + // Most factories prefix `Route "":`; the missing-segment factory in + // `dynamic-rendering.ts` writes `Route: ` on its own line in the body. + const prefixMatch = /^Route "([^"]+)":/.exec(message) + if (prefixMatch) return prefixMatch[1] + const lineMatch = /\nRoute: (\S+)/.exec(message) + return lineMatch ? lineMatch[1] : null } const shouldDisableDevIndicator = From 6d93b2d389c15eee7019f32150f35fe9b89be0db Mon Sep 17 00:00:00 2001 From: Aurora Scharff Date: Sat, 16 May 2026 01:01:43 +0200 Subject: [PATCH 22/34] Match dynamic route templates when clearing instant errors on nav `Route "":` in the error message is the route template (e.g. `/foo/[slug]`), while `state.page` is the resolved URL (e.g. `/foo/123`). Equality matching dropped SSR-streamed errors on the destination page during navigation for any dynamic route. Convert the template to a regex so the clear-on-nav reducer keeps errors whose template matches the page the user just landed on. --- .../src/next-devtools/dev-overlay/shared.ts | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/packages/next/src/next-devtools/dev-overlay/shared.ts b/packages/next/src/next-devtools/dev-overlay/shared.ts index 6012cce07653..151a680b5227 100644 --- a/packages/next/src/next-devtools/dev-overlay/shared.ts +++ b/packages/next/src/next-devtools/dev-overlay/shared.ts @@ -295,6 +295,31 @@ function getInstantErrorRoute(error: unknown): string | null { return lineMatch ? lineMatch[1] : null } +// The route stored on an instant error is the route *template* from +// `workStore.route` (e.g. `/foo/[slug]`), but the page we track in dev +// overlay state is the resolved URL (e.g. `/foo/123`). Convert the template +// to a regex so the clear-on-nav reducer keeps errors whose template matches +// the page the user just landed on. +function routeTemplateMatchesPath(template: string, path: string): boolean { + if (template === path) return true + let hasParam = false + // Split on `[...param]` / `[param]` segments, escape the literal pieces, + // and replace each placeholder with a regex segment matcher. Catch-all + // placeholders match across `/`, single placeholders match one segment. + const tokens = template.split(/(\[(?:\.{3})?[^\]]+\])/) + const pattern = tokens + .map((token) => { + if (token.startsWith('[')) { + hasParam = true + return token.startsWith('[...') ? '.+' : '[^/]+' + } + return token.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') + }) + .join('') + if (!hasParam) return false + return new RegExp(`^${pattern}$`).test(path) +} + const shouldDisableDevIndicator = process.env.__NEXT_DEV_INDICATOR?.toString() === 'false' @@ -564,7 +589,7 @@ export function useErrorOverlayReducer( const remaining = state.errors.filter((event) => { const route = getInstantErrorRoute(event.error) if (route === null) return true - return route === action.currentPath + return routeTemplateMatchesPath(route, action.currentPath) }) if (remaining.length === state.errors.length) { return state From b36f9f0fd3aee8f978b46383432675359f3ee803 Mon Sep 17 00:00:00 2001 From: Aurora Scharff Date: Sat, 16 May 2026 01:03:56 +0200 Subject: [PATCH 23/34] Use shared route-regex helper for template matching --- .../src/next-devtools/dev-overlay/shared.ts | 26 +++++-------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/packages/next/src/next-devtools/dev-overlay/shared.ts b/packages/next/src/next-devtools/dev-overlay/shared.ts index 151a680b5227..03992260c98d 100644 --- a/packages/next/src/next-devtools/dev-overlay/shared.ts +++ b/packages/next/src/next-devtools/dev-overlay/shared.ts @@ -10,6 +10,8 @@ import { isConsoleError } from '../shared/console-error' import type { CacheIndicatorState } from './cache-indicator' import { readInstantNavCookieState } from './components/instant-navs/instant-nav-cookie' import { isBlockingRouteInNavError } from './container/errors' +import { isDynamicRoute } from '../../shared/lib/router/utils/is-dynamic' +import { getRouteRegex } from '../../shared/lib/router/utils/route-regex' export type DevToolsConfig = { theme?: 'light' | 'dark' | 'system' @@ -297,27 +299,13 @@ function getInstantErrorRoute(error: unknown): string | null { // The route stored on an instant error is the route *template* from // `workStore.route` (e.g. `/foo/[slug]`), but the page we track in dev -// overlay state is the resolved URL (e.g. `/foo/123`). Convert the template -// to a regex so the clear-on-nav reducer keeps errors whose template matches -// the page the user just landed on. +// overlay state is the resolved URL (e.g. `/foo/123`). For dynamic routes +// we compile the template to a regex so the clear-on-nav reducer keeps +// errors whose template matches the page the user just landed on. function routeTemplateMatchesPath(template: string, path: string): boolean { if (template === path) return true - let hasParam = false - // Split on `[...param]` / `[param]` segments, escape the literal pieces, - // and replace each placeholder with a regex segment matcher. Catch-all - // placeholders match across `/`, single placeholders match one segment. - const tokens = template.split(/(\[(?:\.{3})?[^\]]+\])/) - const pattern = tokens - .map((token) => { - if (token.startsWith('[')) { - hasParam = true - return token.startsWith('[...') ? '.+' : '[^/]+' - } - return token.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') - }) - .join('') - if (!hasParam) return false - return new RegExp(`^${pattern}$`).test(path) + if (!isDynamicRoute(template)) return false + return getRouteRegex(template).re.test(path) } const shouldDisableDevIndicator = From 5f695d507a321f9d5a8349af67202bbda96ed7e1 Mon Sep 17 00:00:00 2001 From: Aurora Scharff Date: Sat, 16 May 2026 12:44:24 +0200 Subject: [PATCH 24/34] Add unit test --- .../next-devtools/dev-overlay/shared.test.ts | 99 +++++++++++++++++++ .../src/next-devtools/dev-overlay/shared.ts | 7 +- 2 files changed, 104 insertions(+), 2 deletions(-) create mode 100644 packages/next/src/next-devtools/dev-overlay/shared.test.ts diff --git a/packages/next/src/next-devtools/dev-overlay/shared.test.ts b/packages/next/src/next-devtools/dev-overlay/shared.test.ts new file mode 100644 index 000000000000..2419ca596064 --- /dev/null +++ b/packages/next/src/next-devtools/dev-overlay/shared.test.ts @@ -0,0 +1,99 @@ +import { + createDynamicBodyError, + createDynamicBodyErrorInNavigation, + createRuntimeBodyError, + createRuntimeBodyErrorInNavigation, +} from '../../server/app-render/blocking-route-messages' +import { getInstantErrorRoute, routeTemplateMatchesPath } from './shared' + +const STATIC_ROUTE = '/example' +const DYNAMIC_ROUTE_TEMPLATE = '/posts/[slug]' +const CATCH_ALL_ROUTE_TEMPLATE = '/docs/[...slug]' + +describe('getInstantErrorRoute', () => { + it('returns the route for an in-navigation runtime body error', () => { + expect( + getInstantErrorRoute(createRuntimeBodyErrorInNavigation(STATIC_ROUTE)) + ).toBe(STATIC_ROUTE) + }) + + it('returns the route for an in-navigation dynamic body error', () => { + expect( + getInstantErrorRoute( + createDynamicBodyErrorInNavigation(DYNAMIC_ROUTE_TEMPLATE) + ) + ).toBe(DYNAMIC_ROUTE_TEMPLATE) + }) + + it('returns the route for the unrendered-segment wrapper', () => { + const error = new Error( + `Route "${STATIC_ROUTE}": Could not validate instant UI because an expected segment was not rendered.\n\nUnrendered segment:\n app/example/page.tsx` + ) + expect(getInstantErrorRoute(error)).toBe(STATIC_ROUTE) + }) + + it('returns null for SSR-only body errors', () => { + expect(getInstantErrorRoute(createRuntimeBodyError(STATIC_ROUTE))).toBe( + null + ) + expect(getInstantErrorRoute(createDynamicBodyError(STATIC_ROUTE))).toBe( + null + ) + }) + + it('returns null for unrelated errors', () => { + expect(getInstantErrorRoute(new Error('regular bug'))).toBe(null) + }) + + it('returns null for non-Error inputs', () => { + expect(getInstantErrorRoute(null)).toBe(null) + expect(getInstantErrorRoute(undefined)).toBe(null) + expect(getInstantErrorRoute('string error')).toBe(null) + }) +}) + +describe('routeTemplateMatchesPath', () => { + it('matches identical static routes', () => { + expect(routeTemplateMatchesPath(STATIC_ROUTE, STATIC_ROUTE)).toBe(true) + }) + + it('does not match different static routes', () => { + expect(routeTemplateMatchesPath('/foo', '/bar')).toBe(false) + }) + + it('matches a dynamic template against a resolved URL', () => { + expect(routeTemplateMatchesPath(DYNAMIC_ROUTE_TEMPLATE, '/posts/123')).toBe( + true + ) + expect( + routeTemplateMatchesPath(DYNAMIC_ROUTE_TEMPLATE, '/posts/hello-world') + ).toBe(true) + }) + + it('does not match a dynamic template against a sibling route', () => { + expect(routeTemplateMatchesPath(DYNAMIC_ROUTE_TEMPLATE, '/users/123')).toBe( + false + ) + }) + + it('does not match a dynamic template against deeper path segments', () => { + expect( + routeTemplateMatchesPath(DYNAMIC_ROUTE_TEMPLATE, '/posts/2026/05/16') + ).toBe(false) + }) + + it('matches a catch-all template against multiple resolved segments', () => { + expect( + routeTemplateMatchesPath( + CATCH_ALL_ROUTE_TEMPLATE, + '/docs/getting-started' + ) + ).toBe(true) + expect( + routeTemplateMatchesPath( + CATCH_ALL_ROUTE_TEMPLATE, + '/docs/app/api-reference/functions/cookies' + ) + ).toBe(true) + }) +}) diff --git a/packages/next/src/next-devtools/dev-overlay/shared.ts b/packages/next/src/next-devtools/dev-overlay/shared.ts index 03992260c98d..0db34096c6dd 100644 --- a/packages/next/src/next-devtools/dev-overlay/shared.ts +++ b/packages/next/src/next-devtools/dev-overlay/shared.ts @@ -284,7 +284,7 @@ function getStackIgnoringStrictMode(stack: string | undefined) { return stack?.split(REACT_ERROR_STACK_BOTTOM_FRAME_REGEX)[0] } -function getInstantErrorRoute(error: unknown): string | null { +export function getInstantErrorRoute(error: unknown): string | null { if (!error || typeof error !== 'object') return null const message = (error as Error).message if (typeof message !== 'string') return null @@ -302,7 +302,10 @@ function getInstantErrorRoute(error: unknown): string | null { // overlay state is the resolved URL (e.g. `/foo/123`). For dynamic routes // we compile the template to a regex so the clear-on-nav reducer keeps // errors whose template matches the page the user just landed on. -function routeTemplateMatchesPath(template: string, path: string): boolean { +export function routeTemplateMatchesPath( + template: string, + path: string +): boolean { if (template === path) return true if (!isDynamicRoute(template)) return false return getRouteRegex(template).re.test(path) From d157b9e9cfc42193042c935d0251863c5b64ea3e Mon Sep 17 00:00:00 2001 From: Aurora Scharff Date: Sat, 16 May 2026 12:45:29 +0200 Subject: [PATCH 25/34] Remove comments --- .../next-devtools/dev-overlay/container/errors.test.ts | 8 -------- 1 file changed, 8 deletions(-) diff --git a/packages/next/src/next-devtools/dev-overlay/container/errors.test.ts b/packages/next/src/next-devtools/dev-overlay/container/errors.test.ts index 7826dfcd710f..395f7daad31c 100644 --- a/packages/next/src/next-devtools/dev-overlay/container/errors.test.ts +++ b/packages/next/src/next-devtools/dev-overlay/container/errors.test.ts @@ -26,14 +26,6 @@ import { const ROUTE = '/example' -// Every detection helper in errors.tsx walks the user-facing error message -// produced by the server-side factories in `blocking-route-messages.ts` and -// `sync-io-messages.ts`. These tests guard the contract between the two -// modules: if a factory's wording shifts in a way the detector can't -// recognize, classification silently falls back to "not an instant error" -// and the overlay shows the wrong UI. Three regressions in this exact spot -// during the redesign motivated this test. - describe('isRuntimeVariant', () => { it('returns true for runtime body factory output', () => { expect(isRuntimeVariant(createRuntimeBodyError(ROUTE).message)).toBe(true) From de53dfc816ea32059ea6e9197fcae9dd825abfcd Mon Sep 17 00:00:00 2001 From: Aurora Scharff Date: Sat, 16 May 2026 15:44:51 +0200 Subject: [PATCH 26/34] Refine fix cards and messages according to feedback --- packages/next/errors.json | 20 +- .../components/errors/dialog/dialog.tsx | 1 + .../instant/instant-guidance-data.ts | 44 +- .../components/instant/instant-guidance.tsx | 11 +- .../dev-overlay/container/errors.tsx | 16 +- .../app-render/blocking-route-messages.ts | 25 +- .../src/server/app-render/sync-io-messages.ts | 9 +- .../cache-components-dev-cache-scope.test.ts | 4 +- .../cache-components-dev-errors.test.ts | 6 +- ...components-dev-fallback-validation.test.ts | 36 +- .../cache-components-errors.test.ts | 522 +++++++++--------- .../instant-validation-build.test.ts | 2 +- .../instant-validation-level-error.test.ts | 8 +- ...tant-validation-level-manual-error.test.ts | 4 +- ...nt-validation-level-manual-warning.test.ts | 34 +- .../instant-validation-level-warning.test.ts | 2 +- .../instant-validation-static-shells.test.ts | 4 +- .../instant-validation-parallel-slots.test.ts | 32 +- .../instant-validation.test.ts | 149 +++-- .../build-output-prerender.test.ts | 24 +- 20 files changed, 470 insertions(+), 483 deletions(-) diff --git a/packages/next/errors.json b/packages/next/errors.json index 3751e47fbe6b..ac769980260b 100644 --- a/packages/next/errors.json +++ b/packages/next/errors.json @@ -1249,5 +1249,23 @@ "1248": "Could not validate instant UI because an expected segment was not rendered.", "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" + "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": "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" } 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..33815b5605d7 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 @@ -77,7 +77,7 @@ const runtimeCards: FixCard[] = [ }, { id: 'prerender-known-params', - title: 'Prerender known params', + title: 'Prerender params if known', 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..24d9b1b773fa 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 @@ -249,9 +249,8 @@ export const INSTANT_GUIDANCE_STYLES = css` text-decoration: none; } - [data-nextjs-fix-card]:hover { - border-color: var(--color-gray-500); - background: var(--color-background-200); + [data-nextjs-fix-card]:hover [data-nextjs-fix-card-link-icon] { + color: var(--color-gray-1000); } a[data-nextjs-fix-card]:focus-visible { @@ -333,6 +332,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 +346,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/server/app-render/blocking-route-messages.ts b/packages/next/src/server/app-render/blocking-route-messages.ts index 84801cc7a1d0..0e2052ab95cc 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` + + ` - Prerender params if known 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` + + ` - Prerender params if known 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` + + ` - Prerender params if known 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..5a9f841a7882 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` + ? ` - For telemetry, use a timing API such as \`performance.now()\` instead of \`Date.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..34044f7caf08 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 @@ -22,7 +22,7 @@ describe('Cache Components Dev Errors', () => { await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1242", - "description": "Next.js encountered Math.random() without an explicit rendering intent.", + "description": "Next.js encountered the unstable value Math.random() while prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/error/page.tsx (2:23) @ Page @@ -52,7 +52,7 @@ describe('Cache Components Dev Errors', () => { await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1242", - "description": "Next.js encountered Math.random() without an explicit rendering intent.", + "description": "Next.js encountered the unstable value Math.random() while prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/error/page.tsx (2:23) @ Page @@ -99,7 +99,7 @@ describe('Cache Components Dev Errors', () => { await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1220", - "description": "Next.js encountered uncached data during the initial render.", + "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..89fc5e26d25b 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 @@ -53,7 +53,7 @@ describe('Cache Components Fallback Validation', () => { await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/partial/[top]/unwrapped/[bottom]/page.tsx (6:26) @ Page @@ -68,7 +68,7 @@ describe('Cache Components Fallback Validation', () => { await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/partial/[top]/unwrapped/[bottom]/page.tsx (6:26) @ Page @@ -86,7 +86,7 @@ describe('Cache Components Fallback Validation', () => { await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/partial/[top]/unwrapped/[bottom]/page.tsx (6:26) @ Page @@ -101,7 +101,7 @@ describe('Cache Components Fallback Validation', () => { await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/partial/[top]/unwrapped/[bottom]/page.tsx (6:26) @ Page @@ -119,7 +119,7 @@ describe('Cache Components Fallback Validation', () => { await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/partial/[top]/unwrapped/[bottom]/page.tsx (6:26) @ Page @@ -134,7 +134,7 @@ describe('Cache Components Fallback Validation', () => { await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/partial/[top]/unwrapped/[bottom]/page.tsx (6:26) @ Page @@ -156,7 +156,7 @@ describe('Cache Components Fallback Validation', () => { await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/none/[top]/wrapped/layout.tsx (10:3) @ Layout @@ -171,7 +171,7 @@ describe('Cache Components Fallback Validation', () => { await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/none/[top]/wrapped/layout.tsx (10:3) @ Layout @@ -189,7 +189,7 @@ describe('Cache Components Fallback Validation', () => { await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/none/[top]/wrapped/layout.tsx (10:3) @ Layout @@ -204,7 +204,7 @@ describe('Cache Components Fallback Validation', () => { await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/none/[top]/wrapped/layout.tsx (10:3) @ Layout @@ -222,7 +222,7 @@ describe('Cache Components Fallback Validation', () => { await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/none/[top]/wrapped/layout.tsx (10:3) @ Layout @@ -237,7 +237,7 @@ describe('Cache Components Fallback Validation', () => { await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/none/[top]/wrapped/layout.tsx (10:3) @ Layout @@ -255,7 +255,7 @@ describe('Cache Components Fallback Validation', () => { await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/none/[top]/unwrapped/layout.tsx (8:3) @ Layout @@ -270,7 +270,7 @@ describe('Cache Components Fallback Validation', () => { await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/none/[top]/unwrapped/layout.tsx (8:3) @ Layout @@ -288,7 +288,7 @@ describe('Cache Components Fallback Validation', () => { await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/none/[top]/unwrapped/layout.tsx (8:3) @ Layout @@ -303,7 +303,7 @@ describe('Cache Components Fallback Validation', () => { await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/none/[top]/unwrapped/layout.tsx (8:3) @ Layout @@ -321,7 +321,7 @@ describe('Cache Components Fallback Validation', () => { await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/none/[top]/unwrapped/layout.tsx (8:3) @ Layout @@ -336,7 +336,7 @@ describe('Cache Components Fallback Validation', () => { await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "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..f657969a4fa3 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 @@ -159,7 +159,7 @@ describe('Cache Components Errors', () => { await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1220", - "description": "Next.js encountered uncached data during the initial render.", + "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 initial 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 + - Prerender params if known 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 initial 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 + - Prerender params if known 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 initial 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 + - Prerender params if known 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 initial 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 + - Prerender params if known with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -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 @@ -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 @@ -773,7 +769,7 @@ describe('Cache Components Errors', () => { [ { "code": "E1220", - "description": "Next.js encountered uncached data during the initial render.", + "description": "Next.js encountered uncached data during prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/dynamic-root/page.tsx (63:26) @ fetchRandom @@ -787,7 +783,7 @@ describe('Cache Components Errors', () => { }, { "code": "E1220", - "description": "Next.js encountered uncached data during the initial render.", + "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 initial 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 + - Prerender params if known 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 initial 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 + - Prerender params if known 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 initial 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 + - Prerender params if known 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 initial 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 + - Prerender params if known 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 initial 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 + - Prerender params if known 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 initial 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 + - Prerender params if known 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 initial 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 + - Prerender params if known 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 initial 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 + - Prerender params if known with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -1094,7 +1090,7 @@ describe('Cache Components Errors', () => { await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1242", - "description": "Next.js encountered Math.random() without an explicit rendering intent.", + "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. @@ -1242,7 +1238,7 @@ describe('Cache Components Errors', () => { await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1242", - "description": "Next.js encountered Math.random() without an explicit rendering intent.", + "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. @@ -2211,9 +2207,9 @@ 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 \`\` @@ -2237,9 +2233,9 @@ 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 \`\` @@ -2265,9 +2261,9 @@ 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 \`\` @@ -2290,9 +2286,9 @@ 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 \`\` @@ -2326,7 +2322,7 @@ describe('Cache Components Errors', () => { await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "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 +2351,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 initial 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 + - Prerender params if known with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -2383,14 +2379,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 initial 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 + - Prerender params if known with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -2409,14 +2405,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 initial 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 + - Prerender params if known with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -2441,7 +2437,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.' ) } } @@ -2493,9 +2489,9 @@ 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 \`\` @@ -2519,9 +2515,9 @@ 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 \`\` @@ -2547,9 +2543,9 @@ 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 \`\` @@ -2572,9 +2568,9 @@ 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 \`\` @@ -3038,7 +3034,7 @@ describe('Cache Components Errors', () => { await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1221", - "description": "Next.js encountered runtime data during the initial render.", + "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 +3062,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 initial 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 + - Prerender params if known with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -3093,14 +3089,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 initial 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 + - Prerender params if known with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -3120,28 +3116,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 initial 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 + - Prerender params if known 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 initial 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 + - Prerender params if known with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route` @@ -3160,7 +3156,7 @@ 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.", + "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 +3184,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 initial 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 + - Prerender params if known with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -3215,14 +3211,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 initial 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 + - Prerender params if known with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -3242,28 +3238,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 initial 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 + - Prerender params if known 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 initial 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 + - Prerender params if known with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route` @@ -3441,7 +3437,7 @@ 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.", + "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 +3465,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 initial 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 + - Prerender params if known with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -3496,14 +3492,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 initial 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 + - Prerender params if known with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -3523,28 +3519,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 initial 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 + - Prerender params if known 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 initial 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 + - Prerender params if known with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route` @@ -3563,7 +3559,7 @@ 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.", + "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 +3587,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 initial 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 + - Prerender params if known with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -3618,14 +3614,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 initial 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 + - Prerender params if known with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -3645,28 +3641,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 initial 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 + - Prerender params if known 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 initial 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 + - Prerender params if known with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route` @@ -3845,7 +3841,7 @@ 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.", + "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", "source": null, @@ -3871,14 +3867,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 initial 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 + - Prerender params if known with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -3896,14 +3892,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 initial 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 + - Prerender params if known with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -3923,11 +3919,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.` ) } } @@ -4746,7 +4742,7 @@ 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.", + "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 +4771,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 initial 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 + - Prerender params if known with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -4803,14 +4799,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 initial 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 + - Prerender params if known with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -4830,28 +4826,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 initial 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 + - Prerender params if known 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 initial 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 + - Prerender params if known with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -4949,7 +4945,7 @@ 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.", + "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 +4974,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 +4982,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()\` + - For telemetry, use a timing API such as \`performance.now()\` instead of \`Date.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 +5001,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 +5009,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()\` + - For telemetry, use a timing API such as \`performance.now()\` instead of \`Date.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 +5030,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 +5038,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()\` + - For telemetry, use a timing API such as \`performance.now()\` instead of \`Date.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 +5056,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 +5064,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()\` + - For telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` Learn more: https://nextjs.org/docs/messages/next-prerender-current-time at a () @@ -5094,7 +5090,7 @@ 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.", + "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 +5119,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 +5127,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()\` + - For telemetry, use a timing API such as \`performance.now()\` instead of \`Date.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 +5146,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 +5154,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()\` + - For telemetry, use a timing API such as \`performance.now()\` instead of \`Date.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 +5175,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 +5183,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()\` + - For telemetry, use a timing API such as \`performance.now()\` instead of \`Date.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 +5201,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 +5209,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()\` + - For telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` Learn more: https://nextjs.org/docs/messages/next-prerender-current-time at a () @@ -5239,7 +5235,7 @@ 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.", + "description": "Next.js encountered new Date() while prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/sync-io-current-time/new-date/page.tsx (19:16) @ DateReadingComponent @@ -5268,7 +5264,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 \`new Date()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -5276,7 +5272,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()\` + - For telemetry, use a timing API such as \`performance.now()\` instead of \`Date.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 +5291,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 \`new Date()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -5303,7 +5299,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()\` + - For telemetry, use a timing API such as \`performance.now()\` instead of \`Date.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 +5320,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 \`new Date()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -5332,7 +5328,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()\` + - For telemetry, use a timing API such as \`performance.now()\` instead of \`Date.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 +5346,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 \`new Date()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -5358,7 +5354,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()\` + - For telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` Learn more: https://nextjs.org/docs/messages/next-prerender-current-time at a () @@ -5384,7 +5380,7 @@ 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.", + "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 +5409,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 +5435,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 +5463,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 +5488,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. @@ -5525,7 +5521,7 @@ 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.", + "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 +5550,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 +5577,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 +5606,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 +5632,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. @@ -5669,7 +5665,7 @@ 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.", + "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 +5694,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 +5720,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 +5748,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 +5773,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. @@ -5811,7 +5807,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1242", - "description": "Next.js encountered require('node:crypto').generateKeyPairSync(...) without an explicit rendering intent.", + "description": "Next.js encountered 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 @@ -5827,7 +5823,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1242", - "description": "Next.js encountered require('node:crypto').generateKeyPairSync(...) without an explicit rendering intent.", + "description": "Next.js encountered 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 +5853,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 \`require('node:crypto').generateKeyPairSync(...)\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -5884,7 +5880,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 \`require('node:crypto').generateKeyPairSync(...)\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -5912,7 +5908,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 \`require('node:crypto').generateKeyPairSync(...)\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -5939,7 +5935,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 \`require('node:crypto').generateKeyPairSync(...)\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -5973,7 +5969,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1242", - "description": "Next.js encountered require('node:crypto').generateKeySync(...) without an explicit rendering intent.", + "description": "Next.js encountered require('node:crypto').generateKeySync(...) while prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/sync-io-node-crypto/generate-key-sync/page.tsx (21:6) @ SyncIOComponent @@ -5989,7 +5985,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1242", - "description": "Next.js encountered require('node:crypto').generateKeySync(...) without an explicit rendering intent.", + "description": "Next.js encountered 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 +6015,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 \`require('node:crypto').generateKeySync(...)\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -6046,7 +6042,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 \`require('node:crypto').generateKeySync(...)\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -6074,7 +6070,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 \`require('node:crypto').generateKeySync(...)\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -6101,7 +6097,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 \`require('node:crypto').generateKeySync(...)\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -6135,7 +6131,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1242", - "description": "Next.js encountered require('node:crypto').generatePrimeSync(...) without an explicit rendering intent.", + "description": "Next.js encountered require('node:crypto').generatePrimeSync(...) while prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/sync-io-node-crypto/generate-prime-sync/page.tsx (20:39) @ SyncIOComponent @@ -6151,7 +6147,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1242", - "description": "Next.js encountered require('node:crypto').generatePrimeSync(...) without an explicit rendering intent.", + "description": "Next.js encountered 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 +6177,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 \`require('node:crypto').generatePrimeSync(...)\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -6208,7 +6204,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 \`require('node:crypto').generatePrimeSync(...)\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -6236,7 +6232,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 \`require('node:crypto').generatePrimeSync(...)\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -6263,7 +6259,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 \`require('node:crypto').generatePrimeSync(...)\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -6297,7 +6293,7 @@ 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.", + "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 @@ -6313,7 +6309,7 @@ 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.", + "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 +6339,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 +6366,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 +6394,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 +6421,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. @@ -6459,7 +6455,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1242", - "description": "Next.js encountered require('node:crypto').randomBytes(size) without an explicit rendering intent.", + "description": "Next.js encountered require('node:crypto').randomBytes(size) while prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/sync-io-node-crypto/random-bytes/page.tsx (20:24) @ SyncIOComponent @@ -6475,7 +6471,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1242", - "description": "Next.js encountered require('node:crypto').randomBytes(size) without an explicit rendering intent.", + "description": "Next.js encountered 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 +6501,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 \`require('node:crypto').randomBytes(size)\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -6532,7 +6528,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 \`require('node:crypto').randomBytes(size)\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -6560,7 +6556,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 \`require('node:crypto').randomBytes(size)\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -6587,7 +6583,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 \`require('node:crypto').randomBytes(size)\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -6621,7 +6617,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1242", - "description": "Next.js encountered require('node:crypto').randomFillSync(...) without an explicit rendering intent.", + "description": "Next.js encountered require('node:crypto').randomFillSync(...) while prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/sync-io-node-crypto/random-fill-sync/page.tsx (21:10) @ SyncIOComponent @@ -6637,7 +6633,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1242", - "description": "Next.js encountered require('node:crypto').randomFillSync(...) without an explicit rendering intent.", + "description": "Next.js encountered 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 +6663,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 \`require('node:crypto').randomFillSync(...)\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -6694,7 +6690,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 \`require('node:crypto').randomFillSync(...)\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -6722,7 +6718,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 \`require('node:crypto').randomFillSync(...)\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -6749,7 +6745,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 \`require('node:crypto').randomFillSync(...)\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -6783,7 +6779,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1242", - "description": "Next.js encountered require('node:crypto').randomInt(min, max) without an explicit rendering intent.", + "description": "Next.js encountered 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 @@ -6799,7 +6795,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1242", - "description": "Next.js encountered require('node:crypto').randomInt(min, max) without an explicit rendering intent.", + "description": "Next.js encountered 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 +6825,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 \`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 +6852,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 \`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 +6880,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 \`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 +6907,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 \`require('node:crypto').randomInt(min, max)\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -6945,7 +6941,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1242", - "description": "Next.js encountered require('node:crypto').randomInt(min, max) without an explicit rendering intent.", + "description": "Next.js encountered 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 @@ -6961,7 +6957,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1242", - "description": "Next.js encountered require('node:crypto').randomInt(min, max) without an explicit rendering intent.", + "description": "Next.js encountered 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 +6987,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 \`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 +7014,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 \`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 +7042,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 \`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 +7069,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 \`require('node:crypto').randomInt(min, max)\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -7107,7 +7103,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1242", - "description": "Next.js encountered require('node:crypto').randomUUID() without an explicit rendering intent.", + "description": "Next.js encountered require('node:crypto').randomUUID() while prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/sync-io-node-crypto/random-uuid/page.tsx (20:24) @ SyncIOComponent @@ -7123,7 +7119,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1242", - "description": "Next.js encountered require('node:crypto').randomUUID() without an explicit rendering intent.", + "description": "Next.js encountered 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 +7149,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 \`require('node:crypto').randomUUID()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -7180,7 +7176,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 \`require('node:crypto').randomUUID()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -7208,7 +7204,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 \`require('node:crypto').randomUUID()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -7235,7 +7231,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 \`require('node:crypto').randomUUID()\` while prerendering. This value can change between renders, so it must be either prerendered or computed later. @@ -7268,7 +7264,7 @@ 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.", + "description": "Next.js encountered uncached data during prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/client-awaited-io/client.tsx (6:19) @ Client @@ -7297,14 +7293,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 initial 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 + - Prerender params if known with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -7325,14 +7321,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 initial 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 + - Prerender params if known with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -7356,14 +7352,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 initial 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 + - Prerender params if known with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -7384,14 +7380,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 initial 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 + - Prerender params if known 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-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..ac65cb53ea9a 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 @@ -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..562d0dd571fd 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 @@ -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..ea0909bdf144 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 @@ -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. @@ -230,7 +230,7 @@ describe('instant validation - level manual-warning', () => { await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1220", - "description": "Next.js encountered uncached data during the initial render.", + "description": "Next.js encountered uncached data during prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/without-root-suspense/bare/page.tsx (10:19) @ Page @@ -250,7 +250,7 @@ describe('instant validation - level manual-warning', () => { await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1220", - "description": "Next.js encountered uncached data during the initial render.", + "description": "Next.js encountered uncached data during prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/without-root-suspense/explicit-error/page.tsx (11:19) @ Page @@ -270,7 +270,7 @@ describe('instant validation - level manual-warning', () => { await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1220", - "description": "Next.js encountered uncached data during the initial render.", + "description": "Next.js encountered uncached data during prerendering.", "environmentLabel": "Server", "label": "Instant", "source": "app/without-root-suspense/explicit-true/page.tsx (11:19) @ Page @@ -290,7 +290,7 @@ describe('instant validation - level manual-warning', () => { await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1220", - "description": "Next.js encountered uncached data during the initial render.", + "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 initial 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 + - Prerender params if known 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 initial 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 + - Prerender params if known 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 initial 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 + - Prerender params if known 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 initial 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 + - Prerender params if known 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..e28bd61ac935 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 @@ -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..1d8a7447ce39 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 @@ -46,7 +46,7 @@ describe('instant validation', () => { await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1220", - "description": "Next.js encountered uncached data during the initial render.", + "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..349bc861f96b 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 @@ -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 + - Prerender params if known with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -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 + - Prerender params if known with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -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 + - Prerender params if known with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -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 + - Prerender params if known with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -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 + - Prerender params if known 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 + - Prerender params if known with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -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 + - Prerender params if known with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -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 + - Prerender params if known 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..e7901ea3990a 100644 --- a/test/e2e/app-dir/instant-validation/instant-validation.test.ts +++ b/test/e2e/app-dir/instant-validation/instant-validation.test.ts @@ -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 + - Prerender params if known with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -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. @@ -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. @@ -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 + - Prerender params if known with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -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. @@ -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 + - Prerender params if known with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -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 + - Prerender params if known with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -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. @@ -745,7 +745,7 @@ describe('instant validation', () => { await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1242", - "description": "Next.js encountered Date.now() without an explicit rendering intent.", + "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()\` + - For telemetry, use a timing API such as \`performance.now()\` instead of \`Date.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()\` + - For telemetry, use a timing API such as \`performance.now()\` instead of \`Date.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) @@ -823,7 +823,7 @@ describe('instant validation', () => { await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1242", - "description": "Next.js encountered Date.now() without an explicit rendering intent.", + "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()\` + - For telemetry, use a timing API such as \`performance.now()\` instead of \`Date.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()\` + - For telemetry, use a timing API such as \`performance.now()\` instead of \`Date.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()\` + - For telemetry, use a timing API such as \`performance.now()\` instead of \`Date.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) @@ -926,7 +926,7 @@ describe('instant validation', () => { await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1242", - "description": "Next.js encountered Date.now() without an explicit rendering intent.", + "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 @@ -994,7 +994,7 @@ describe('instant validation', () => { await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1242", - "description": "Next.js encountered Date.now() without an explicit rendering intent.", + "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()\` + - For telemetry, use a timing API such as \`performance.now()\` instead of \`Date.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()\` + - For telemetry, use a timing API such as \`performance.now()\` instead of \`Date.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) @@ -1090,7 +1090,7 @@ describe('instant validation', () => { await expect(browser).toDisplayCollapsedRedbox(` { "code": "E1242", - "description": "Next.js encountered Date.now() without an explicit rendering intent.", + "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()\` + - For telemetry, use a timing API such as \`performance.now()\` instead of \`Date.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()\` + - For telemetry, use a timing API such as \`performance.now()\` instead of \`Date.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()\` + - For telemetry, use a timing API such as \`performance.now()\` instead of \`Date.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) @@ -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. @@ -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. @@ -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 + - Prerender params if known with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -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 + - Prerender params if known with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -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. @@ -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 + - Prerender params if known with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -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 + - Prerender params if known with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -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 + - Prerender params if known with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -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 @@ -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 @@ -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 @@ -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 + - Prerender params if known with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -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 + - Prerender params if known with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -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 + - Prerender params if known with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -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 + - Prerender params if known with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -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 + - Prerender params if known with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -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 + - Prerender params if known with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -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 + - Prerender params if known with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -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 + - Prerender params if known with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -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 + - Prerender params if known with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -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 + - Prerender params if known with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -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 + - Prerender params if known with \`generateStaticParams\` - Set \`export const instant = false\` to allow a blocking route Learn more: https://nextjs.org/docs/messages/blocking-route @@ -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. 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..5b001e713733 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 + - For telemetry, use a timing API such as \`performance.now()\` instead of \`Date.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 + - For telemetry, use a timing API such as \`performance.now()\` instead of \`Date.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 + - For telemetry, use a timing API such as \`performance.now()\` instead of \`Date.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 + - For telemetry, use a timing API such as \`performance.now()\` instead of \`Date.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. From 00e6f2c3e738ddb5d86229413f8f5ac2971fd5ca Mon Sep 17 00:00:00 2001 From: Aurora Scharff Date: Sat, 16 May 2026 16:14:13 +0200 Subject: [PATCH 27/34] Update messages --- packages/next/errors.json | 5 +- .../instant/instant-guidance-data.ts | 2 +- .../components/instant/instant-guidance.tsx | 11 +- .../app-render/blocking-route-messages.ts | 6 +- .../src/server/app-render/sync-io-messages.ts | 2 +- .../cache-components-errors.test.ts | 106 +++++++++--------- ...nt-validation-level-manual-warning.test.ts | 8 +- .../instant-validation-parallel-slots.test.ts | 16 +-- .../instant-validation.test.ts | 60 +++++----- .../build-output-prerender.test.ts | 8 +- 10 files changed, 118 insertions(+), 106 deletions(-) diff --git a/packages/next/errors.json b/packages/next/errors.json index ac769980260b..9f723b9f4fba 100644 --- a/packages/next/errors.json +++ b/packages/next/errors.json @@ -1267,5 +1267,8 @@ "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" + "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" } 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 33815b5605d7..cbae52183433 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 @@ -77,7 +77,7 @@ const runtimeCards: FixCard[] = [ }, { id: 'prerender-known-params', - title: 'Prerender params if known', + title: 'For known params, prerender', group: 'cache', link: 'https://nextjs.org/docs/messages/blocking-route#prerender-known-params', 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 24d9b1b773fa..1d4002ea504a 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 @@ -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; } @@ -249,10 +248,20 @@ export const INSTANT_GUIDANCE_STYLES = css` text-decoration: none; } + [data-nextjs-fix-card]:hover { + border-color: var(--color-gray-500); + 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; 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 0e2052ab95cc..7fb52f50ac55 100644 --- a/packages/next/src/server/app-render/blocking-route-messages.ts +++ b/packages/next/src/server/app-render/blocking-route-messages.ts @@ -4,7 +4,7 @@ export function createRuntimeBodyError(route: string): Error { `\`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` + - ` - Prerender params if known with \`generateStaticParams\`\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` ) @@ -28,7 +28,7 @@ export function createRuntimeBodyErrorInNavigation(route: string): Error { `\`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` + - ` - Prerender params if known with \`generateStaticParams\`\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` ) @@ -58,7 +58,7 @@ export function createDynamicOrRuntimeBodyError(route: string): Error { `Ways 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` + + ` - 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` ) 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 5a9f841a7882..2fcf07dc0939 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' - ? ` - For telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\`\n` + ? ` - If the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\`\n` : '' } 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 f657969a4fa3..1a91d0680563 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 @@ -196,7 +196,7 @@ describe('Cache Components Errors', () => { Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 @@ -224,7 +224,7 @@ describe('Cache Components Errors', () => { Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 @@ -248,7 +248,7 @@ describe('Cache Components Errors', () => { Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 @@ -276,7 +276,7 @@ describe('Cache Components Errors', () => { Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 @@ -821,7 +821,7 @@ describe('Cache Components Errors', () => { Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 @@ -843,7 +843,7 @@ describe('Cache Components Errors', () => { Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 @@ -872,7 +872,7 @@ describe('Cache Components Errors', () => { Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 @@ -897,7 +897,7 @@ describe('Cache Components Errors', () => { Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 @@ -921,7 +921,7 @@ describe('Cache Components Errors', () => { Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 @@ -943,7 +943,7 @@ describe('Cache Components Errors', () => { Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 @@ -972,7 +972,7 @@ describe('Cache Components Errors', () => { Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 @@ -1011,7 +1011,7 @@ describe('Cache Components Errors', () => { Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 @@ -2358,7 +2358,7 @@ describe('Cache Components Errors', () => { Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 @@ -2386,7 +2386,7 @@ describe('Cache Components Errors', () => { Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 @@ -2412,7 +2412,7 @@ describe('Cache Components Errors', () => { Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 @@ -3069,7 +3069,7 @@ describe('Cache Components Errors', () => { Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 @@ -3096,7 +3096,7 @@ describe('Cache Components Errors', () => { Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 @@ -3123,7 +3123,7 @@ describe('Cache Components Errors', () => { Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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` @@ -3137,7 +3137,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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` @@ -3191,7 +3191,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 @@ -3218,7 +3218,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 @@ -3245,7 +3245,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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` @@ -3259,7 +3259,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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` @@ -3472,7 +3472,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 @@ -3499,7 +3499,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 @@ -3526,7 +3526,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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` @@ -3540,7 +3540,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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` @@ -3594,7 +3594,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 @@ -3621,7 +3621,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 @@ -3648,7 +3648,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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` @@ -3662,7 +3662,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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` @@ -3874,7 +3874,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 @@ -3899,7 +3899,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 @@ -4778,7 +4778,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 @@ -4806,7 +4806,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 @@ -4833,7 +4833,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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` @@ -4847,7 +4847,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 @@ -4982,7 +4982,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"\` - - For telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` + - Optionally, if the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` Learn more: https://nextjs.org/docs/messages/next-prerender-current-time at DateReadingComponent (app/sync-io-current-time/date/page.tsx:19:16) @@ -5009,7 +5009,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"\` - - For telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` + - Optionally, if the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.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) @@ -5038,7 +5038,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"\` - - For telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` + - Optionally, if the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` Learn more: https://nextjs.org/docs/messages/next-prerender-current-time at a (app/sync-io-current-time/date/page.tsx:19:16) @@ -5064,7 +5064,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"\` - - For telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` + - Optionally, if the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` Learn more: https://nextjs.org/docs/messages/next-prerender-current-time at a () @@ -5127,7 +5127,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"\` - - For telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` + - Optionally, if the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.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) @@ -5154,7 +5154,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"\` - - For telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` + - Optionally, if the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.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) @@ -5183,7 +5183,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"\` - - For telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` + - Optionally, if the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.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) @@ -5209,7 +5209,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"\` - - For telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` + - Optionally, if the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` Learn more: https://nextjs.org/docs/messages/next-prerender-current-time at a () @@ -5272,7 +5272,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"\` - - For telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` + - Optionally, if the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.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) @@ -5299,7 +5299,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"\` - - For telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` + - Optionally, if the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.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) @@ -5328,7 +5328,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"\` - - For telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` + - Optionally, if the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.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) @@ -5354,7 +5354,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"\` - - For telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` + - Optionally, if the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` Learn more: https://nextjs.org/docs/messages/next-prerender-current-time at a () @@ -7300,7 +7300,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 @@ -7328,7 +7328,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 @@ -7359,7 +7359,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 @@ -7387,7 +7387,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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-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 ea0909bdf144..4650953e60b0 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 @@ -337,7 +337,7 @@ describe('instant validation - level manual-warning', () => { Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 @@ -363,7 +363,7 @@ describe('instant validation - level manual-warning', () => { Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 @@ -391,7 +391,7 @@ describe('instant validation - level manual-warning', () => { Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 - level manual-warning', () => { Ways to fix this: - Cache the data access with \`"use cache"\` - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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-parallel-slots.test.ts b/test/e2e/app-dir/instant-validation/instant-validation-parallel-slots.test.ts index 349bc861f96b..59c7fee67a39 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 @@ -148,7 +148,7 @@ describe('instant validation - parallel slot configs', () => { Ways to fix this: - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 @@ -208,7 +208,7 @@ describe('instant validation - parallel slot configs', () => { Ways to fix this: - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 @@ -268,7 +268,7 @@ describe('instant validation - parallel slot configs', () => { Ways to fix this: - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 @@ -330,7 +330,7 @@ describe('instant validation - parallel slot configs', () => { Ways to fix this: - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 @@ -417,7 +417,7 @@ describe('instant validation - parallel slot configs', () => { Ways to fix this: - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 @@ -431,7 +431,7 @@ describe('instant validation - parallel slot configs', () => { Ways to fix this: - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 @@ -557,7 +557,7 @@ describe('instant validation - parallel slot configs', () => { Ways to fix this: - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 @@ -672,7 +672,7 @@ describe('instant validation - parallel slot configs', () => { Ways to fix this: - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 e7901ea3990a..c27e352ab0e3 100644 --- a/test/e2e/app-dir/instant-validation/instant-validation.test.ts +++ b/test/e2e/app-dir/instant-validation/instant-validation.test.ts @@ -204,7 +204,7 @@ describe('instant validation', () => { Ways to fix this: - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 @@ -387,7 +387,7 @@ describe('instant validation', () => { Ways to fix this: - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 @@ -558,7 +558,7 @@ describe('instant validation', () => { Ways to fix this: - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 @@ -653,7 +653,7 @@ describe('instant validation', () => { Ways to fix this: - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 @@ -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"\` - - For telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` + - Optionally, if the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.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) @@ -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"\` - - For telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` + - Optionally, if the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.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) @@ -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"\` - - For telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` + - Optionally, if the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.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) @@ -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"\` - - For telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` + - Optionally, if the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.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) @@ -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"\` - - For telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` + - Optionally, if the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.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) @@ -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"\` - - For telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` + - Optionally, if the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.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) @@ -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"\` - - For telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` + - Optionally, if the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.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) @@ -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"\` - - For telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` + - Optionally, if the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.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) @@ -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"\` - - For telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` + - Optionally, if the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.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) @@ -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"\` - - For telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` + - Optionally, if the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.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) @@ -1396,7 +1396,7 @@ describe('instant validation', () => { Ways to fix this: - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 @@ -1484,7 +1484,7 @@ describe('instant validation', () => { Ways to fix this: - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 @@ -1609,7 +1609,7 @@ describe('instant validation', () => { Ways to fix this: - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 @@ -1671,7 +1671,7 @@ describe('instant validation', () => { Ways to fix this: - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 @@ -1733,7 +1733,7 @@ describe('instant validation', () => { Ways to fix this: - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 @@ -2601,7 +2601,7 @@ describe('instant validation', () => { Ways to fix this: - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 @@ -2662,7 +2662,7 @@ describe('instant validation', () => { Ways to fix this: - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 @@ -2724,7 +2724,7 @@ describe('instant validation', () => { Ways to fix this: - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 @@ -2786,7 +2786,7 @@ describe('instant validation', () => { Ways to fix this: - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 @@ -2848,7 +2848,7 @@ describe('instant validation', () => { Ways to fix this: - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 @@ -2917,7 +2917,7 @@ describe('instant validation', () => { Ways to fix this: - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 @@ -2993,7 +2993,7 @@ describe('instant validation', () => { Ways to fix this: - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 @@ -3063,7 +3063,7 @@ describe('instant validation', () => { Ways to fix this: - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 @@ -3134,7 +3134,7 @@ describe('instant validation', () => { Ways to fix this: - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 @@ -3253,7 +3253,7 @@ describe('instant validation', () => { Ways to fix this: - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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 @@ -3317,7 +3317,7 @@ describe('instant validation', () => { Ways to fix this: - Provide a placeholder with \`\` around the data access - - Prerender params if known with \`generateStaticParams\` + - 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/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 5b001e713733..49f429b102c4 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 @@ -78,7 +78,7 @@ describe('build-output-prerender', () => { Ways to fix this: - Wrap the Client Component in \`\` - Move the read into a \`useEffect\` or event handler - - For telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` + - If the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` Learn more: https://nextjs.org/docs/messages/next-prerender-current-time-client at (app/client/page.tsx:4:28) @@ -103,7 +103,7 @@ describe('build-output-prerender', () => { Ways to fix this: - Wrap the Client Component in \`\` - Move the read into a \`useEffect\` or event handler - - For telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` + - If the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` Learn more: https://nextjs.org/docs/messages/next-prerender-current-time-client at x () @@ -219,7 +219,7 @@ describe('build-output-prerender', () => { Ways to fix this: - Wrap the Client Component in \`\` - Move the read into a \`useEffect\` or event handler - - For telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` + - If the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` Learn more: https://nextjs.org/docs/messages/next-prerender-current-time-client at Page (app/client/page.tsx:4:28) @@ -266,7 +266,7 @@ describe('build-output-prerender', () => { Ways to fix this: - Wrap the Client Component in \`\` - Move the read into a \`useEffect\` or event handler - - For telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` + - If the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` Learn more: https://nextjs.org/docs/messages/next-prerender-current-time-client at Page (webpack:///app/client/page.tsx:4:28) From b5daeb66ffb2596d38005e7ba46335c205f4c1e6 Mon Sep 17 00:00:00 2001 From: Aurora Scharff Date: Mon, 18 May 2026 21:16:38 +0200 Subject: [PATCH 28/34] Use loading icon for Block group and fix instant validation snapshots --- .../instant/instant-guidance-data.ts | 3 +- .../components/instant/instant-guidance.tsx | 3 + .../dev-overlay/icons/fix-card-icons.tsx | 30 +++++++++ .../cache-components-dev-errors.test.ts | 2 +- .../cache-components-errors.test.ts | 22 +++---- .../instant-validation-causes.test.ts | 8 +-- .../instant-validation-level-error.test.ts | 10 +-- ...tant-validation-level-manual-error.test.ts | 6 +- ...nt-validation-level-manual-warning.test.ts | 14 ++--- .../instant-validation-level-warning.test.ts | 10 +-- .../instant-validation-static-shells.test.ts | 2 +- .../instant-validation-parallel-slots.test.ts | 16 ++--- .../instant-validation.test.ts | 62 +++++++++---------- 13 files changed, 111 insertions(+), 77 deletions(-) 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 cbae52183433..063b65b29dd1 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,6 +16,7 @@ export type FixCardIcon = | 'database' | 'history' | 'layout' + | 'loading' | 'octagon' | 'pointer-click' | 'server-stack' @@ -28,7 +29,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' }, 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 1d4002ea504a..00dd9693e888 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,6 +3,7 @@ import { FixCardDatabaseIcon, FixCardHistoryIcon, FixCardLayoutIcon, + FixCardLoadingIcon, FixCardOctagonIcon, FixCardPointerClickIcon, FixCardServerStackIcon, @@ -43,6 +44,8 @@ function getCardIcon(icon: FixCardIcon) { return case 'octagon': return + case 'loading': + return case 'zap': return case 'layout': 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..f534f7508703 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 @@ -65,6 +65,36 @@ export function FixCardOctagonIcon() { ) } +export function FixCardLoadingIcon() { + return ( + + {Array.from({ length: 12 }, (_, index) => { + const angle = index * 30 + const opacity = 1 - index * 0.05 + + return ( + + ) + })} + + ) +} + export function FixCardLayoutIcon() { return ( { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1220", + "code": "E1265", "description": "Next.js encountered uncached data during prerendering.", "environmentLabel": "Server", "label": "Instant", 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 1a91d0680563..10ed75da4d09 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,7 +158,7 @@ describe('Cache Components Errors', () => { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1220", + "code": "E1265", "description": "Next.js encountered uncached data during prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -768,7 +768,7 @@ describe('Cache Components Errors', () => { await expect(browser).toDisplayCollapsedRedbox(` [ { - "code": "E1220", + "code": "E1265", "description": "Next.js encountered uncached data during prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -782,7 +782,7 @@ describe('Cache Components Errors', () => { ], }, { - "code": "E1220", + "code": "E1265", "description": "Next.js encountered uncached data during prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -2321,7 +2321,7 @@ describe('Cache Components Errors', () => { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1221", + "code": "E1272", "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -3033,7 +3033,7 @@ describe('Cache Components Errors', () => { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1221", + "code": "E1272", "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -3155,7 +3155,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1221", + "code": "E1272", "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -3436,7 +3436,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1221", + "code": "E1272", "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -3558,7 +3558,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1221", + "code": "E1272", "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -3840,7 +3840,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1221", + "code": "E1272", "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -4741,7 +4741,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1221", + "code": "E1272", "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -7263,7 +7263,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1220", + "code": "E1265", "description": "Next.js encountered uncached data during prerendering.", "environmentLabel": "Server", "label": "Instant", 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 ac65cb53ea9a..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", 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 562d0dd571fd..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", 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 4650953e60b0..f9366aab6d2a 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", @@ -229,7 +229,7 @@ describe('instant validation - level manual-warning', () => { // did not run under 'manual-warning'. await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1220", + "code": "E1265", "description": "Next.js encountered uncached data during prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -249,7 +249,7 @@ describe('instant validation - level manual-warning', () => { ) await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1220", + "code": "E1265", "description": "Next.js encountered uncached data during prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -269,7 +269,7 @@ describe('instant validation - level manual-warning', () => { ) await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1220", + "code": "E1265", "description": "Next.js encountered uncached data during prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -289,7 +289,7 @@ describe('instant validation - level manual-warning', () => { ) await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1220", + "code": "E1265", "description": "Next.js encountered uncached data during prerendering.", "environmentLabel": "Server", "label": "Instant", 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 e28bd61ac935..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", 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 1d8a7447ce39..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,7 +45,7 @@ describe('instant validation', () => { await browser.elementByCss('main') await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1220", + "code": "E1265", "description": "Next.js encountered uncached data during prerendering.", "environmentLabel": "Server", "label": "Instant", 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 59c7fee67a39..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", @@ -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", @@ -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", @@ -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", @@ -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", @@ -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", @@ -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", 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 c27e352ab0e3..b8e3a5ed5098 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", @@ -240,7 +240,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1249", + "code": "E1264", "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -300,7 +300,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1249", + "code": "E1264", "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -363,7 +363,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1251", + "code": "E1271", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -423,7 +423,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1249", + "code": "E1264", "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -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", @@ -629,7 +629,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1251", + "code": "E1271", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -692,7 +692,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1249", + "code": "E1264", "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -1231,7 +1231,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1249", + "code": "E1264", "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -1295,7 +1295,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1249", + "code": "E1264", "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -1372,7 +1372,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1251", + "code": "E1271", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -1460,7 +1460,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1251", + "code": "E1271", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -1521,7 +1521,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1249", + "code": "E1264", "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -1585,7 +1585,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1251", + "code": "E1271", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -1647,7 +1647,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1251", + "code": "E1271", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -1709,7 +1709,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1251", + "code": "E1271", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -2577,7 +2577,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1251", + "code": "E1271", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -2638,7 +2638,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1251", + "code": "E1271", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -2700,7 +2700,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1251", + "code": "E1271", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -2762,7 +2762,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1251", + "code": "E1271", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -2824,7 +2824,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1251", + "code": "E1271", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -2893,7 +2893,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1251", + "code": "E1271", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -2969,7 +2969,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1251", + "code": "E1271", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -3039,7 +3039,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1251", + "code": "E1271", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -3110,7 +3110,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1251", + "code": "E1271", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -3178,7 +3178,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1251", + "code": "E1271", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -3229,7 +3229,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1251", + "code": "E1271", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -3293,7 +3293,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1251", + "code": "E1271", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -3358,7 +3358,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1251", + "code": "E1271", "description": "Next.js encountered runtime data during a navigation.", "environmentLabel": "Server", "label": "Instant", @@ -3685,7 +3685,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1249", + "code": "E1264", "description": "Next.js encountered uncached data during a navigation.", "environmentLabel": "Server", "label": "Instant", From b8a0ae96410783df3bdcc7a721e8c1b23e3cb9f0 Mon Sep 17 00:00:00 2001 From: Aurora Scharff Date: Mon, 18 May 2026 21:30:33 +0200 Subject: [PATCH 29/34] fix sync-IO snapshot codes --- .../cache-components-dev-errors.test.ts | 4 +- .../cache-components-errors.test.ts | 52 +++++++++---------- .../instant-validation.test.ts | 10 ++-- 3 files changed, 33 insertions(+), 33 deletions(-) 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 5e08c5fc7e16..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,7 +21,7 @@ describe('Cache Components Dev Errors', () => { // soft-navigating to the page (see test below). await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", + "code": "E1261", "description": "Next.js encountered the unstable value Math.random() while prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -51,7 +51,7 @@ describe('Cache Components Dev Errors', () => { // TODO: React should not include the anon stack in the Owner Stack. await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", + "code": "E1261", "description": "Next.js encountered the unstable value Math.random() while prerendering.", "environmentLabel": "Server", "label": "Instant", 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 10ed75da4d09..ea5b1af4c771 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 @@ -1089,7 +1089,7 @@ describe('Cache Components Errors', () => { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", + "code": "E1261", "description": "Next.js encountered the unstable value Math.random() while prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -1237,7 +1237,7 @@ describe('Cache Components Errors', () => { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", + "code": "E1261", "description": "Next.js encountered the unstable value Math.random() while prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -4944,7 +4944,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", + "code": "E1261", "description": "Next.js encountered the unstable value Date() while prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -5089,7 +5089,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", + "code": "E1261", "description": "Next.js encountered the unstable value Date.now() while prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -5234,7 +5234,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", + "code": "E1259", "description": "Next.js encountered new Date() while prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -5379,7 +5379,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", + "code": "E1261", "description": "Next.js encountered the unstable value Math.random() while prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -5520,7 +5520,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", + "code": "E1261", "description": "Next.js encountered the unstable value crypto.getRandomValues() while prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -5664,7 +5664,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", + "code": "E1261", "description": "Next.js encountered the unstable value crypto.randomUUID() while prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -5806,7 +5806,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` if (isTurbopack) { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", + "code": "E1259", "description": "Next.js encountered require('node:crypto').generateKeyPairSync(...) while prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -5822,7 +5822,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` } else { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", + "code": "E1259", "description": "Next.js encountered require('node:crypto').generateKeyPairSync(...) while prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -5968,7 +5968,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` if (isTurbopack) { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", + "code": "E1259", "description": "Next.js encountered require('node:crypto').generateKeySync(...) while prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -5984,7 +5984,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` } else { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", + "code": "E1259", "description": "Next.js encountered require('node:crypto').generateKeySync(...) while prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -6130,7 +6130,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` if (isTurbopack) { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", + "code": "E1259", "description": "Next.js encountered require('node:crypto').generatePrimeSync(...) while prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -6146,7 +6146,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` } else { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", + "code": "E1259", "description": "Next.js encountered require('node:crypto').generatePrimeSync(...) while prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -6292,7 +6292,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` if (isTurbopack) { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", + "code": "E1261", "description": "Next.js encountered the unstable value crypto.getRandomValues() while prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -6308,7 +6308,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` } else { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", + "code": "E1261", "description": "Next.js encountered the unstable value crypto.getRandomValues() while prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -6454,7 +6454,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` if (isTurbopack) { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", + "code": "E1259", "description": "Next.js encountered require('node:crypto').randomBytes(size) while prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -6470,7 +6470,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` } else { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", + "code": "E1259", "description": "Next.js encountered require('node:crypto').randomBytes(size) while prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -6616,7 +6616,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` if (isTurbopack) { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", + "code": "E1259", "description": "Next.js encountered require('node:crypto').randomFillSync(...) while prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -6632,7 +6632,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` } else { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", + "code": "E1259", "description": "Next.js encountered require('node:crypto').randomFillSync(...) while prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -6778,7 +6778,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` if (isTurbopack) { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", + "code": "E1259", "description": "Next.js encountered require('node:crypto').randomInt(min, max) while prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -6794,7 +6794,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` } else { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", + "code": "E1259", "description": "Next.js encountered require('node:crypto').randomInt(min, max) while prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -6940,7 +6940,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` if (isTurbopack) { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", + "code": "E1259", "description": "Next.js encountered require('node:crypto').randomInt(min, max) while prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -6956,7 +6956,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` } else { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", + "code": "E1259", "description": "Next.js encountered require('node:crypto').randomInt(min, max) while prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -7102,7 +7102,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` if (isTurbopack) { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", + "code": "E1259", "description": "Next.js encountered require('node:crypto').randomUUID() while prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -7118,7 +7118,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` } else { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", + "code": "E1259", "description": "Next.js encountered require('node:crypto').randomUUID() while prerendering.", "environmentLabel": "Server", "label": "Instant", 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 b8e3a5ed5098..9c066fc36b05 100644 --- a/test/e2e/app-dir/instant-validation/instant-validation.test.ts +++ b/test/e2e/app-dir/instant-validation/instant-validation.test.ts @@ -744,7 +744,7 @@ describe('instant validation', () => { ) await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", + "code": "E1261", "description": "Next.js encountered the unstable value Date.now() while prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -822,7 +822,7 @@ describe('instant validation', () => { ) await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", + "code": "E1261", "description": "Next.js encountered the unstable value Date.now() while prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -925,7 +925,7 @@ describe('instant validation', () => { ) await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", + "code": "E1261", "description": "Next.js encountered the unstable value Date.now() while prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -993,7 +993,7 @@ describe('instant validation', () => { ) await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", + "code": "E1261", "description": "Next.js encountered the unstable value Date.now() while prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -1089,7 +1089,7 @@ describe('instant validation', () => { ) await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1242", + "code": "E1261", "description": "Next.js encountered the unstable value Date.now() while prerendering.", "environmentLabel": "Server", "label": "Instant", From fb66c4ef474002b140f3d2a5fceffd050aa846b6 Mon Sep 17 00:00:00 2001 From: Aurora Scharff Date: Mon, 18 May 2026 22:24:49 +0200 Subject: [PATCH 30/34] fix failing e2e tests --- ...components-dev-fallback-validation.test.ts | 36 ++++---- .../cache-components-errors.test.ts | 82 +++++++++---------- ...nt-validation-level-manual-warning.test.ts | 8 +- 3 files changed, 63 insertions(+), 63 deletions(-) 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 89fc5e26d25b..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,7 +52,7 @@ describe('Cache Components Fallback Validation', () => { if (isTurbopack) { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1221", + "code": "E1272", "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -67,7 +67,7 @@ describe('Cache Components Fallback Validation', () => { } else { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1221", + "code": "E1272", "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -85,7 +85,7 @@ describe('Cache Components Fallback Validation', () => { if (isTurbopack) { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1221", + "code": "E1272", "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -100,7 +100,7 @@ describe('Cache Components Fallback Validation', () => { } else { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1221", + "code": "E1272", "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -118,7 +118,7 @@ describe('Cache Components Fallback Validation', () => { if (isTurbopack) { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1221", + "code": "E1272", "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -133,7 +133,7 @@ describe('Cache Components Fallback Validation', () => { } else { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1221", + "code": "E1272", "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -155,7 +155,7 @@ describe('Cache Components Fallback Validation', () => { if (isTurbopack) { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1221", + "code": "E1272", "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -170,7 +170,7 @@ describe('Cache Components Fallback Validation', () => { } else { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1221", + "code": "E1272", "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -188,7 +188,7 @@ describe('Cache Components Fallback Validation', () => { if (isTurbopack) { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1221", + "code": "E1272", "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -203,7 +203,7 @@ describe('Cache Components Fallback Validation', () => { } else { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1221", + "code": "E1272", "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -221,7 +221,7 @@ describe('Cache Components Fallback Validation', () => { if (isTurbopack) { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1221", + "code": "E1272", "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -236,7 +236,7 @@ describe('Cache Components Fallback Validation', () => { } else { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1221", + "code": "E1272", "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -254,7 +254,7 @@ describe('Cache Components Fallback Validation', () => { if (isTurbopack) { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1221", + "code": "E1272", "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -269,7 +269,7 @@ describe('Cache Components Fallback Validation', () => { } else { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1221", + "code": "E1272", "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -287,7 +287,7 @@ describe('Cache Components Fallback Validation', () => { if (isTurbopack) { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1221", + "code": "E1272", "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -302,7 +302,7 @@ describe('Cache Components Fallback Validation', () => { } else { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1221", + "code": "E1272", "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -320,7 +320,7 @@ describe('Cache Components Fallback Validation', () => { if (isTurbopack) { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1221", + "code": "E1272", "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", @@ -335,7 +335,7 @@ describe('Cache Components Fallback Validation', () => { } else { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1221", + "code": "E1272", "description": "Next.js encountered runtime data during prerendering.", "environmentLabel": "Server", "label": "Instant", 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 ea5b1af4c771..43415884f05a 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 @@ -191,7 +191,7 @@ describe('Cache Components Errors', () => { expect(output).toMatchInlineSnapshot(` "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 the initial page load 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"\` @@ -219,7 +219,7 @@ describe('Cache Components Errors', () => { expect(output).toMatchInlineSnapshot(` "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 the initial page load 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"\` @@ -243,7 +243,7 @@ describe('Cache Components Errors', () => { expect(output).toMatchInlineSnapshot(` "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 the initial page load 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"\` @@ -271,7 +271,7 @@ describe('Cache Components Errors', () => { expect(output).toMatchInlineSnapshot(` "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 the initial page load 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"\` @@ -816,7 +816,7 @@ describe('Cache Components Errors', () => { expect(output).toMatchInlineSnapshot(` "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 the initial page load 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"\` @@ -838,7 +838,7 @@ describe('Cache Components Errors', () => { 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 prerendering. - \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking the initial page load 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"\` @@ -867,7 +867,7 @@ describe('Cache Components Errors', () => { expect(output).toMatchInlineSnapshot(` "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 the initial page load 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"\` @@ -892,7 +892,7 @@ describe('Cache Components Errors', () => { - 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 prerendering. - \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking the initial page load 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"\` @@ -916,7 +916,7 @@ describe('Cache Components Errors', () => { expect(output).toMatchInlineSnapshot(` "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 the initial page load 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"\` @@ -938,7 +938,7 @@ describe('Cache Components Errors', () => { 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 prerendering. - \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking the initial page load 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"\` @@ -967,7 +967,7 @@ describe('Cache Components Errors', () => { expect(output).toMatchInlineSnapshot(` "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 the initial page load 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"\` @@ -1006,7 +1006,7 @@ describe('Cache Components Errors', () => { - 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 prerendering. - \`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking the initial page load 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"\` @@ -2353,7 +2353,7 @@ describe('Cache Components Errors', () => { expect(output).toMatchInlineSnapshot(` "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 the initial page load 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"\` @@ -2381,7 +2381,7 @@ describe('Cache Components Errors', () => { expect(output).toMatchInlineSnapshot(` "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 the initial page load 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"\` @@ -2407,7 +2407,7 @@ describe('Cache Components Errors', () => { expect(output).toMatchInlineSnapshot(` "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 the initial page load 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"\` @@ -3064,7 +3064,7 @@ describe('Cache Components Errors', () => { expect(output).toMatchInlineSnapshot(` "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 the initial page load 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"\` @@ -3091,7 +3091,7 @@ describe('Cache Components Errors', () => { expect(output).toMatchInlineSnapshot(` "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 the initial page load 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"\` @@ -3118,7 +3118,7 @@ describe('Cache Components Errors', () => { expect(output).toInclude( `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 the initial page load 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"\` @@ -3132,7 +3132,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` expect(output).toInclude( `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 the initial page load 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"\` @@ -3186,7 +3186,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` expect(output).toMatchInlineSnapshot(` "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 the initial page load 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"\` @@ -3213,7 +3213,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` expect(output).toMatchInlineSnapshot(` "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 the initial page load 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"\` @@ -3240,7 +3240,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` expect(output).toInclude( `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 the initial page load 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"\` @@ -3254,7 +3254,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` expect(output).toInclude( `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 the initial page load 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"\` @@ -3467,7 +3467,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` expect(output).toMatchInlineSnapshot(` "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 the initial page load 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"\` @@ -3494,7 +3494,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` expect(output).toMatchInlineSnapshot(` "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 the initial page load 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"\` @@ -3521,7 +3521,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` expect(output).toInclude( `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 the initial page load 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"\` @@ -3535,7 +3535,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` expect(output).toInclude( `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 the initial page load 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"\` @@ -3589,7 +3589,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` expect(output).toMatchInlineSnapshot(` "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 the initial page load 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"\` @@ -3616,7 +3616,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` expect(output).toMatchInlineSnapshot(` "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 the initial page load 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"\` @@ -3643,7 +3643,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` expect(output).toInclude( `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 the initial page load 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"\` @@ -3657,7 +3657,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` expect(output).toInclude( `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 the initial page load 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"\` @@ -3869,7 +3869,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` expect(output).toMatchInlineSnapshot(` "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 the initial page load 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"\` @@ -3894,7 +3894,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` expect(output).toMatchInlineSnapshot(` "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 the initial page load 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"\` @@ -4773,7 +4773,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` expect(output).toMatchInlineSnapshot(` "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 the initial page load 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"\` @@ -4801,7 +4801,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` expect(output).toMatchInlineSnapshot(` "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 the initial page load 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"\` @@ -4828,7 +4828,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` expect(output).toInclude( `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 the initial page load 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"\` @@ -4842,7 +4842,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` expect(output).toMatchInlineSnapshot(` "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 the initial page load 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"\` @@ -7295,7 +7295,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` expect(output).toMatchInlineSnapshot(` "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 the initial page load 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"\` @@ -7323,7 +7323,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` expect(output).toMatchInlineSnapshot(` "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 the initial page load 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"\` @@ -7354,7 +7354,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` expect(output).toMatchInlineSnapshot(` "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 the initial page load 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"\` @@ -7382,7 +7382,7 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` expect(output).toMatchInlineSnapshot(` "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 the initial page load 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"\` 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 f9366aab6d2a..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 @@ -332,7 +332,7 @@ describe('instant validation - level manual-warning', () => { .toMatchInlineSnapshot(` "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 the initial page load 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"\` @@ -358,7 +358,7 @@ describe('instant validation - level manual-warning', () => { .toMatchInlineSnapshot(` "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 the initial page load 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"\` @@ -386,7 +386,7 @@ describe('instant validation - level manual-warning', () => { .toMatchInlineSnapshot(` "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 the initial page load 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"\` @@ -418,7 +418,7 @@ describe('instant validation - level manual-warning', () => { .toMatchInlineSnapshot(` "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 the initial page load 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"\` From 53f18f5dab9c8b2fd1dfb03fa265665dfd30a763 Mon Sep 17 00:00:00 2001 From: Aurora Scharff Date: Mon, 18 May 2026 22:38:22 +0200 Subject: [PATCH 31/34] fix snapshot test failures --- .../cache-components-errors.test.ts | 184 +++++++++--------- .../instant-validation.test.ts | 20 +- 2 files changed, 106 insertions(+), 98 deletions(-) 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 43415884f05a..00d044788ba9 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 @@ -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", @@ -676,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", @@ -2177,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 @@ -2214,6 +2214,7 @@ describe('Cache Components Errors', () => { 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()\` instead of \`Date.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) @@ -2240,6 +2241,7 @@ describe('Cache Components Errors', () => { 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()\` instead of \`Date.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) @@ -2268,6 +2270,7 @@ describe('Cache Components Errors', () => { 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()\` instead of \`Date.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) @@ -2293,6 +2296,7 @@ describe('Cache Components Errors', () => { 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()\` instead of \`Date.now()\` Learn more: https://nextjs.org/docs/messages/next-prerender-current-time-client at a () @@ -2459,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 @@ -2496,6 +2500,7 @@ describe('Cache Components Errors', () => { 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()\` instead of \`Date.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) @@ -2522,6 +2527,7 @@ describe('Cache Components Errors', () => { 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()\` instead of \`Date.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) @@ -2550,6 +2556,7 @@ describe('Cache Components Errors', () => { 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()\` instead of \`Date.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) @@ -2575,6 +2582,7 @@ describe('Cache Components Errors', () => { 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()\` instead of \`Date.now()\` Learn more: https://nextjs.org/docs/messages/next-prerender-current-time-client at a () @@ -4982,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"\` - - Optionally, if the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` + - If the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` Learn more: https://nextjs.org/docs/messages/next-prerender-current-time at DateReadingComponent (app/sync-io-current-time/date/page.tsx:19:16) @@ -5009,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"\` - - Optionally, if the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` + - If the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.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) @@ -5038,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"\` - - Optionally, if the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` + - If the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` Learn more: https://nextjs.org/docs/messages/next-prerender-current-time at a (app/sync-io-current-time/date/page.tsx:19:16) @@ -5064,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"\` - - Optionally, if the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` + - If the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` Learn more: https://nextjs.org/docs/messages/next-prerender-current-time at a () @@ -5127,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"\` - - Optionally, if the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` + - If the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.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) @@ -5154,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"\` - - Optionally, if the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` + - If the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.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) @@ -5183,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"\` - - Optionally, if the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` + - If the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.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) @@ -5209,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"\` - - Optionally, if the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` + - If the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` Learn more: https://nextjs.org/docs/messages/next-prerender-current-time at a () @@ -5234,8 +5242,8 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1259", - "description": "Next.js encountered new Date() while prerendering.", + "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 @@ -5264,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()\` while prerendering. + "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. @@ -5272,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"\` - - Optionally, if the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` + - If the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.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) @@ -5291,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()\` while prerendering. + "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. @@ -5299,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"\` - - Optionally, if the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` + - If the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.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) @@ -5320,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()\` while prerendering. + "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. @@ -5328,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"\` - - Optionally, if the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` + - If the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.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) @@ -5346,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()\` while prerendering. + "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. @@ -5354,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"\` - - Optionally, if the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` + - If the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` Learn more: https://nextjs.org/docs/messages/next-prerender-current-time at a () @@ -5806,8 +5814,8 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` if (isTurbopack) { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1259", - "description": "Next.js encountered require('node:crypto').generateKeyPairSync(...) while prerendering.", + "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 @@ -5822,8 +5830,8 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` } else { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1259", - "description": "Next.js encountered require('node:crypto').generateKeyPairSync(...) while prerendering.", + "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 @@ -5853,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(...)\` while prerendering. + "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. @@ -5880,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(...)\` while prerendering. + "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. @@ -5908,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(...)\` while prerendering. + "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. @@ -5935,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(...)\` while prerendering. + "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. @@ -5968,8 +5976,8 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` if (isTurbopack) { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1259", - "description": "Next.js encountered require('node:crypto').generateKeySync(...) while prerendering.", + "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 @@ -5984,8 +5992,8 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` } else { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1259", - "description": "Next.js encountered require('node:crypto').generateKeySync(...) while prerendering.", + "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 @@ -6015,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(...)\` while prerendering. + "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. @@ -6042,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(...)\` while prerendering. + "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. @@ -6070,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(...)\` while prerendering. + "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. @@ -6097,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(...)\` while prerendering. + "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. @@ -6130,8 +6138,8 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` if (isTurbopack) { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1259", - "description": "Next.js encountered require('node:crypto').generatePrimeSync(...) while prerendering.", + "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 @@ -6146,8 +6154,8 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` } else { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1259", - "description": "Next.js encountered require('node:crypto').generatePrimeSync(...) while prerendering.", + "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 @@ -6177,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(...)\` while prerendering. + "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. @@ -6204,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(...)\` while prerendering. + "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. @@ -6232,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(...)\` while prerendering. + "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. @@ -6259,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(...)\` while prerendering. + "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. @@ -6454,8 +6462,8 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` if (isTurbopack) { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1259", - "description": "Next.js encountered require('node:crypto').randomBytes(size) while prerendering.", + "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 @@ -6470,8 +6478,8 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` } else { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1259", - "description": "Next.js encountered require('node:crypto').randomBytes(size) while prerendering.", + "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 @@ -6501,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)\` while prerendering. + "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. @@ -6528,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)\` while prerendering. + "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. @@ -6556,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)\` while prerendering. + "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. @@ -6583,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)\` while prerendering. + "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. @@ -6616,8 +6624,8 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` if (isTurbopack) { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1259", - "description": "Next.js encountered require('node:crypto').randomFillSync(...) while prerendering.", + "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 @@ -6632,8 +6640,8 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` } else { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1259", - "description": "Next.js encountered require('node:crypto').randomFillSync(...) while prerendering.", + "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 @@ -6663,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(...)\` while prerendering. + "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. @@ -6690,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(...)\` while prerendering. + "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. @@ -6718,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(...)\` while prerendering. + "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. @@ -6745,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(...)\` while prerendering. + "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. @@ -6778,8 +6786,8 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` if (isTurbopack) { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1259", - "description": "Next.js encountered require('node:crypto').randomInt(min, max) while prerendering.", + "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 @@ -6794,8 +6802,8 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` } else { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1259", - "description": "Next.js encountered require('node:crypto').randomInt(min, max) while prerendering.", + "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 @@ -6825,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)\` while prerendering. + "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. @@ -6852,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)\` while prerendering. + "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. @@ -6880,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)\` while prerendering. + "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. @@ -6907,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)\` while prerendering. + "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. @@ -6940,8 +6948,8 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` if (isTurbopack) { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1259", - "description": "Next.js encountered require('node:crypto').randomInt(min, max) while prerendering.", + "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 @@ -6956,8 +6964,8 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` } else { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1259", - "description": "Next.js encountered require('node:crypto').randomInt(min, max) while prerendering.", + "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 @@ -6987,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)\` while prerendering. + "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. @@ -7014,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)\` while prerendering. + "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. @@ -7042,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)\` while prerendering. + "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. @@ -7069,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)\` while prerendering. + "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. @@ -7102,8 +7110,8 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` if (isTurbopack) { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1259", - "description": "Next.js encountered require('node:crypto').randomUUID() while prerendering.", + "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 @@ -7118,8 +7126,8 @@ Learn more: https://nextjs.org/docs/messages/blocking-route` } else { await expect(browser).toDisplayCollapsedRedbox(` { - "code": "E1259", - "description": "Next.js encountered require('node:crypto').randomUUID() while prerendering.", + "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 @@ -7149,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()\` while prerendering. + "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. @@ -7176,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()\` while prerendering. + "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. @@ -7204,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()\` while prerendering. + "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. @@ -7231,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()\` while prerendering. + "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. 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 9c066fc36b05..1a96209b3b6b 100644 --- a/test/e2e/app-dir/instant-validation/instant-validation.test.ts +++ b/test/e2e/app-dir/instant-validation/instant-validation.test.ts @@ -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"\` - - Optionally, if the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` + - If the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.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) @@ -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"\` - - Optionally, if the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` + - If the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.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) @@ -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"\` - - Optionally, if the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` + - If the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.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) @@ -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"\` - - Optionally, if the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` + - If the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.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) @@ -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"\` - - Optionally, if the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` + - If the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.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) @@ -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"\` - - Optionally, if the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` + - If the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.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) @@ -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"\` - - Optionally, if the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` + - If the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.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) @@ -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"\` - - Optionally, if the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` + - If the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.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) @@ -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"\` - - Optionally, if the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` + - If the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.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) @@ -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"\` - - Optionally, if the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\` + - If the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.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) From 83f925ea304bca299aacae4686392a89ea47cae8 Mon Sep 17 00:00:00 2001 From: Aurora Scharff Date: Mon, 18 May 2026 22:54:45 +0200 Subject: [PATCH 32/34] fix remaining viewport error code snapshots --- .../app-dir/instant-validation/instant-validation.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 1a96209b3b6b..6ef157aec689 100644 --- a/test/e2e/app-dir/instant-validation/instant-validation.test.ts +++ b/test/e2e/app-dir/instant-validation/instant-validation.test.ts @@ -2362,7 +2362,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1208", + "code": "E1252", "description": "Next.js encountered runtime data in generateViewport().", "environmentLabel": "Server", "label": "Instant", @@ -2421,7 +2421,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1210", + "code": "E1255", "description": "Next.js encountered uncached data in generateViewport().", "environmentLabel": "Server", "label": "Instant", @@ -2518,7 +2518,7 @@ describe('instant validation', () => { ], }, ], - "code": "E1210", + "code": "E1255", "description": "Next.js encountered uncached data in generateViewport().", "environmentLabel": "Server", "label": "Instant", From fd256a02f4fee78e85cb582a44394c3d5a5c5798 Mon Sep 17 00:00:00 2001 From: Aurora Scharff Date: Tue, 19 May 2026 00:10:19 +0200 Subject: [PATCH 33/34] Refine syncio messages --- .../src/server/app-render/sync-io-messages.ts | 2 +- .../cache-components-errors.test.ts | 40 +++++++++---------- .../instant-validation.test.ts | 20 +++++----- .../build-output-prerender.test.ts | 8 ++-- 4 files changed, 35 insertions(+), 35 deletions(-) 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 2fcf07dc0939..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' - ? ` - If the value is for telemetry, use a timing API such as \`performance.now()\` instead of \`Date.now()\`\n` + ? ` - If the value is for telemetry, use a timing API such as \`performance.now()\`\n` : '' } 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 00d044788ba9..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 @@ -2214,7 +2214,7 @@ describe('Cache Components Errors', () => { 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()\` 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-client at SyncIO (app/sync-attribution/guarded-async-unguarded-clientsync/client.tsx:5:16) @@ -2241,7 +2241,7 @@ describe('Cache Components Errors', () => { 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()\` 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-client at SyncIO (webpack:///app/sync-attribution/guarded-async-unguarded-clientsync/client.tsx:5:16) @@ -2270,7 +2270,7 @@ describe('Cache Components Errors', () => { 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()\` 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-client at (app/sync-attribution/guarded-async-unguarded-clientsync/client.tsx:5:16) @@ -2296,7 +2296,7 @@ describe('Cache Components Errors', () => { 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()\` 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-client at a () @@ -2500,7 +2500,7 @@ describe('Cache Components Errors', () => { 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()\` 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-client at SyncIO (app/sync-attribution/unguarded-async-unguarded-clientsync/client.tsx:5:16) @@ -2527,7 +2527,7 @@ describe('Cache Components Errors', () => { 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()\` 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-client at SyncIO (webpack:///app/sync-attribution/unguarded-async-unguarded-clientsync/client.tsx:5:16) @@ -2556,7 +2556,7 @@ describe('Cache Components Errors', () => { 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()\` 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-client at (app/sync-attribution/unguarded-async-unguarded-clientsync/client.tsx:5:16) @@ -2582,7 +2582,7 @@ describe('Cache Components Errors', () => { 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()\` 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-client at a () @@ -4990,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"\` - - If the value is for telemetry, use a timing API such as \`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) @@ -5017,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"\` - - If the value is for telemetry, use a timing API such as \`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) @@ -5046,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"\` - - If the value is for telemetry, use a timing API such as \`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) @@ -5072,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"\` - - If the value is for telemetry, use a timing API such as \`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 () @@ -5135,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"\` - - If the value is for telemetry, use a timing API such as \`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) @@ -5162,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"\` - - If the value is for telemetry, use a timing API such as \`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) @@ -5191,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"\` - - If the value is for telemetry, use a timing API such as \`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) @@ -5217,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"\` - - If the value is for telemetry, use a timing API such as \`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 () @@ -5280,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"\` - - If the value is for telemetry, use a timing API such as \`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) @@ -5307,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"\` - - If the value is for telemetry, use a timing API such as \`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) @@ -5336,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"\` - - If the value is for telemetry, use a timing API such as \`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) @@ -5362,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"\` - - If the value is for telemetry, use a timing API such as \`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 () 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 6ef157aec689..ef3778dedb5b 100644 --- a/test/e2e/app-dir/instant-validation/instant-validation.test.ts +++ b/test/e2e/app-dir/instant-validation/instant-validation.test.ts @@ -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"\` - - If the value is for telemetry, use a timing API such as \`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) @@ -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"\` - - If the value is for telemetry, use a timing API such as \`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) @@ -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"\` - - If the value is for telemetry, use a timing API such as \`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) @@ -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"\` - - If the value is for telemetry, use a timing API such as \`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) @@ -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"\` - - If the value is for telemetry, use a timing API such as \`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) @@ -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"\` - - If the value is for telemetry, use a timing API such as \`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) @@ -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"\` - - If the value is for telemetry, use a timing API such as \`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) @@ -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"\` - - If the value is for telemetry, use a timing API such as \`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) @@ -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"\` - - If the value is for telemetry, use a timing API such as \`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) @@ -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"\` - - If the value is for telemetry, use a timing API such as \`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) 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 49f429b102c4..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 @@ -78,7 +78,7 @@ describe('build-output-prerender', () => { 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()\` 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-client at (app/client/page.tsx:4:28) @@ -103,7 +103,7 @@ describe('build-output-prerender', () => { 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()\` 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-client at x () @@ -219,7 +219,7 @@ describe('build-output-prerender', () => { 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()\` 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-client at Page (app/client/page.tsx:4:28) @@ -266,7 +266,7 @@ describe('build-output-prerender', () => { 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()\` 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-client at Page (webpack:///app/client/page.tsx:4:28) From 9e287ae4d311ad60d1aee54fe10f7e418fe82425 Mon Sep 17 00:00:00 2001 From: Aurora Scharff Date: Tue, 19 May 2026 00:41:47 +0200 Subject: [PATCH 34/34] Delete unused icon --- .../instant/instant-guidance-data.ts | 1 - .../components/instant/instant-guidance.tsx | 3 --- .../dev-overlay/icons/fix-card-icons.tsx | 19 ------------------- 3 files changed, 23 deletions(-) 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 063b65b29dd1..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 @@ -17,7 +17,6 @@ export type FixCardIcon = | 'history' | 'layout' | 'loading' - | 'octagon' | 'pointer-click' | 'server-stack' | 'timer' 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 00dd9693e888..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 @@ -4,7 +4,6 @@ import { FixCardHistoryIcon, FixCardLayoutIcon, FixCardLoadingIcon, - FixCardOctagonIcon, FixCardPointerClickIcon, FixCardServerStackIcon, FixCardTimerIcon, @@ -42,8 +41,6 @@ function getCardIcon(icon: FixCardIcon) { return case 'timer': return - case 'octagon': - return case 'loading': return case 'zap': 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 f534f7508703..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,25 +46,6 @@ export function FixCardHistoryIcon() { ) } -export function FixCardOctagonIcon() { - return ( - - - - ) -} - export function FixCardLoadingIcon() { return (