Unverified Commit 18d2e2da authored by Aurora Scharff's avatar Aurora Scharff Committed by GitHub

Insights: use a single Learn more link in console errors (#95967)

## Summary

The instant / blocking-prerender insight console errors printed a docs
URL under each fix option (two or three anchors per message). This
collapses them to a single `Learn more:` link at the end of each
message, while keeping the `[stream]`/`[cache]`/`[block]` fix-option
labels. It restores the single-link format these builders originally
shipped with.

**Before:**

```
Ways to fix this:
  - [stream] Provide a placeholder with `<Suspense fallback={...}>` around the data access
    https://nextjs.org/docs/messages/blocking-prerender-runtime#wrap-in-or-move-into-suspense
  - [block] Set `export const instant = false` to allow a blocking route
    https://nextjs.org/docs/messages/blocking-prerender-runtime#allow-blocking-route
```

**After:**

```
Ways to fix this:
  - [stream] Provide a placeholder with `<Suspense fallback={...}>` around the data access
  - [block] Set `export const instant = false` to allow a blocking route

Learn more: https://nextjs.org/docs/messages/blocking-prerender-runtime
```

Covers all 16 insight-kind errors, across `blocking-route-messages.ts`,
`sync-io-messages.ts`, `dynamic-rendering-utils.ts`, and
`instant-messages.ts`.

Because the dev overlay classified these errors by the `#`-anchored docs
URL, `getBlockingRouteErrorDetails` is updated to match the anchor-less
`Learn more:` URL. Console-message snapshots and the guidance-data
extraction test are updated to the new format. The dev-overlay fix-card
data (`instant-guidance-data.ts`) keeps its per-card links, since those
are the overlay UI rather than the console message.

## Verification

- `pnpm --filter=next types`
- Snapshots regenerated with `jest -u` for the affected suites

<!-- NEXT_JS_LLM -->
parent 380f0946
...@@ -112,11 +112,10 @@ Error: Route "/products/[id]": Next.js encountered uncached or runtime data duri ...@@ -112,11 +112,10 @@ Error: Route "/products/[id]": Next.js encountered uncached or runtime data duri
Ways to fix this: Ways to fix this:
- [stream] Provide a placeholder with `<Suspense fallback={...}>` around the data access - [stream] Provide a placeholder with `<Suspense fallback={...}>` around the data access
https://nextjs.org/docs/messages/blocking-prerender-dynamic#wrap-in-or-move-into-suspense
- [cache] For uncached data (`fetch`, database calls): cache the access with `"use cache"` (does not apply to `connection()`) - [cache] For uncached data (`fetch`, database calls): cache the access with `"use cache"` (does not apply to `connection()`)
https://nextjs.org/docs/messages/blocking-prerender-dynamic#cache-the-component-or-data
- [block] Set `export const instant = false` to allow a blocking route - [block] Set `export const instant = false` to allow a blocking route
https://nextjs.org/docs/messages/blocking-prerender-dynamic#allow-blocking-route
Learn more: https://nextjs.org/docs/messages/blocking-prerender-dynamic
at body (<anonymous>) at body (<anonymous>)
at html (<anonymous>) at html (<anonymous>)
To get a more detailed stack trace and pinpoint the issue, try one of the following: To get a more detailed stack trace and pinpoint the issue, try one of the following:
......
This diff is collapsed.
...@@ -115,80 +115,7 @@ describe('instant-guidance-data card ordering', () => { ...@@ -115,80 +115,7 @@ describe('instant-guidance-data card ordering', () => {
) )
}) })
function linksFromMessage(message: string): string[] {
return Array.from(message.matchAll(/^\s+(https:\/\/\S+)/gm)).map((m) => m[1])
}
describe('instant-guidance-data card links', () => { describe('instant-guidance-data card links', () => {
it.each([
[
'blocking-route runtime',
createRuntimeBodyError('/x').message,
'blocking-route',
'runtime',
],
[
'blocking-route dynamic',
createDynamicBodyError('/x').message,
'blocking-route',
'dynamic',
],
[
'blocking-route link',
createLinkBodyErrorInNavigation('/x').message,
'blocking-route',
'link',
],
[
'metadata runtime',
createRuntimeMetadataError('/x').message,
'metadata',
'runtime',
],
[
'metadata dynamic',
createDynamicMetadataError('/x').message,
'metadata',
'dynamic',
],
[
'metadata link',
createLinkMetadataError('/x').message,
'metadata',
'link',
],
[
'viewport runtime',
createRuntimeViewportError('/x').message,
'viewport',
'runtime',
],
[
'viewport dynamic',
createDynamicViewportError('/x').message,
'viewport',
'dynamic',
],
[
'viewport link',
createLinkViewportError('/x').message,
'viewport',
'link',
],
[
'link-prefetch-partial',
createLinkPrefetchPartialError('/x').message,
'link-prefetch-partial',
'runtime',
],
] as const)(
'console URLs and overlay card links agree for %s',
(_name, message, kind, variant) => {
const cardLinks = getCards(kind, variant).map((card) => card.link)
expect(linksFromMessage(message)).toEqual(cardLinks)
}
)
it('every card.link ends with #card.id', () => { it('every card.link ends with #card.id', () => {
const variants: Array<[GuidanceKind, GuidanceVariant]> = [ const variants: Array<[GuidanceKind, GuidanceVariant]> = [
['blocking-route', 'runtime'], ['blocking-route', 'runtime'],
......
...@@ -441,9 +441,9 @@ export function getBlockingRouteErrorDetails( ...@@ -441,9 +441,9 @@ export function getBlockingRouteErrorDetails(
} }
const isBlockingPageLoadError = const isBlockingPageLoadError =
message.includes('/blocking-prerender-runtime#') || message.includes('/blocking-prerender-runtime') ||
message.includes('/blocking-prerender-dynamic#') || message.includes('/blocking-prerender-dynamic') ||
message.includes('/instant-shell-url-data#') message.includes('/instant-shell-url-data')
if (isBlockingPageLoadError) { if (isBlockingPageLoadError) {
return { return {
type: 'blocking-route', type: 'blocking-route',
......
...@@ -18,18 +18,12 @@ const SYNC_IO_RUNTIME_DOCS: Record<SyncIOApiType, string> = { ...@@ -18,18 +18,12 @@ const SYNC_IO_RUNTIME_DOCS: Record<SyncIOApiType, string> = {
crypto: 'https://nextjs.org/docs/messages/blocking-prerender-crypto', crypto: 'https://nextjs.org/docs/messages/blocking-prerender-crypto',
} }
function elapsedTimeBullet(type: SyncIOApiType, docsUrl: string): string { function elapsedTimeBullet(type: SyncIOApiType): string {
return type === 'time' return type === 'time'
? `\n - [measure] If the value is for telemetry, use a timing API such as \`performance.now()\`\n ${docsUrl}#for-telemetry-use-a-timing-api` ? `\n - [measure] If the value is for telemetry, use a timing API such as \`performance.now()\``
: '' : ''
} }
const CACHE_ANCHOR: Record<SyncIOApiType, string> = {
random: '#cache-the-random-value',
time: '#cache-the-timestamp',
crypto: '#cache-the-generated-value',
}
function createSyncIOErrorImpl( function createSyncIOErrorImpl(
route: string, route: string,
expression: string, expression: string,
...@@ -40,10 +34,11 @@ function createSyncIOErrorImpl( ...@@ -40,10 +34,11 @@ function createSyncIOErrorImpl(
`Route "${route}": Next.js encountered the unstable value ${expression} while prerendering.\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` + `This value can change between renders, so it must be either prerendered or computed later.\n\n` +
`Ways to fix this:\n` + `Ways to fix this:\n` +
` - [dynamic] Render at request time by adding a dynamic data access (e.g. \`await connection()\`) before this call\n ${docsUrl}#generate-on-every-request\n` + ` - [dynamic] Render at request time by adding a dynamic data access (e.g. \`await connection()\`) before this call\n` +
` - [cache] Prerender and cache the value with \`"use cache"\`\n ${docsUrl}${CACHE_ANCHOR[type]}\n` + ` - [cache] Prerender and cache the value with \`"use cache"\`\n` +
` - [client] Render the value on the client with \`"use client"\`\n ${docsUrl}#render-on-the-client` + ` - [client] Render the value on the client with \`"use client"\`` +
elapsedTimeBullet(type, docsUrl) elapsedTimeBullet(type) +
`\n\nLearn more: ${docsUrl}`
) )
} }
...@@ -78,8 +73,9 @@ export function createSyncIOClientError( ...@@ -78,8 +73,9 @@ export function createSyncIOClientError(
`Route "${route}": Next.js encountered the unstable value ${expression} in a Client Component.\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` + `This value would be evaluated during the prerender, instead of recomputed on each visit.\n\n` +
`Ways to fix this:\n` + `Ways to fix this:\n` +
` - [stream] Wrap the Client Component in \`<Suspense fallback={...}>\`\n ${docsUrl}#wrap-in-or-move-into-suspense\n` + ` - [stream] Wrap the Client Component in \`<Suspense fallback={...}>\`\n` +
` - [defer] Move the read into a \`useEffect\` or event handler\n ${docsUrl}#move-into-effect-or-event-handler` + ` - [defer] Move the read into a \`useEffect\` or event handler` +
elapsedTimeBullet(type, docsUrl) elapsedTimeBullet(type) +
`\n\nLearn more: ${docsUrl}`
) )
} }
...@@ -42,9 +42,8 @@ export class ClientHookDynamicError extends Error { ...@@ -42,9 +42,8 @@ export class ClientHookDynamicError extends Error {
`This blocks prerendering because the value is only available at runtime.\n\n` + `This blocks prerendering because the value is only available at runtime.\n\n` +
`Ways to fix this:\n` + `Ways to fix this:\n` +
` - [stream] Wrap the component in \`<Suspense fallback={...}>\` so the hook value streams in after prerendering\n` + ` - [stream] Wrap the component in \`<Suspense fallback={...}>\` so the hook value streams in after prerendering\n` +
` https://nextjs.org/docs/messages/blocking-prerender-client-hook#wrap-in-or-move-into-suspense\n` + ` - [block] Set \`export const instant = false\` to allow a blocking route\n\n` +
` - [block] Set \`export const instant = false\` to allow a blocking route\n` + `Learn more: https://nextjs.org/docs/messages/blocking-prerender-client-hook`
` https://nextjs.org/docs/messages/blocking-prerender-client-hook#allow-blocking-route`
) )
} }
} }
......
...@@ -11,9 +11,8 @@ export function createUnrenderedSegmentError( ...@@ -11,9 +11,8 @@ export function createUnrenderedSegmentError(
`\n\n${label}:\n${missingFiles.map((p) => ` ${p}`).join('\n')}` + `\n\n${label}:\n${missingFiles.map((p) => ` ${p}`).join('\n')}` +
`\n\nWays to fix this:` + `\n\nWays to fix this:` +
`\n - [render] Render the dropped segment` + `\n - [render] Render the dropped segment` +
`\n https://nextjs.org/docs/messages/instant-unrendered-segment#render-the-dropped-segment` +
`\n - [ignore] Set \`export const instant = false\` to opt the dropped segment out of instant-navigation validation` + `\n - [ignore] Set \`export const instant = false\` to opt the dropped segment out of instant-navigation validation` +
`\n https://nextjs.org/docs/messages/instant-unrendered-segment#skip-validation-on-the-segment` `\n\nLearn more: https://nextjs.org/docs/messages/instant-unrendered-segment`
} }
return new Error(message) return new Error(message)
} }
...@@ -24,10 +23,8 @@ export function createLinkPrefetchPartialError(pathname: string): Error { ...@@ -24,10 +23,8 @@ export function createLinkPrefetchPartialError(pathname: string): Error {
`This will lead to slower, more expensive prefetches.\n\n` + `This will lead to slower, more expensive prefetches.\n\n` +
`Ways to fix this:\n` + `Ways to fix this:\n` +
` - [upgrade] Opt into Partial Prefetching by exporting \`const prefetch = 'partial'\` from the page or layout, or by setting \`partialPrefetching: true\` in next.config to opt the whole app in\n` + ` - [upgrade] Opt into Partial Prefetching by exporting \`const prefetch = 'partial'\` from the page or layout, or by setting \`partialPrefetching: true\` in next.config to opt the whole app in\n` +
` https://nextjs.org/docs/messages/instant-link-prefetch-partial#opt-into-partial-prefetching\n` +
` - [disable] Remove \`prefetch={true}\` from the <Link> to use the default prefetch\n` + ` - [disable] Remove \`prefetch={true}\` from the <Link> to use the default prefetch\n` +
` https://nextjs.org/docs/messages/instant-link-prefetch-partial#use-the-default-prefetch\n` + ` - [ignore] Set \`export const instant = false\` to opt the route out of instant-navigation validation\n\n` +
` - [ignore] Set \`export const instant = false\` to opt the route out of instant-navigation validation\n` + `Learn more: https://nextjs.org/docs/messages/instant-link-prefetch-partial`
` https://nextjs.org/docs/messages/instant-link-prefetch-partial#disable-validation-on-this-route`
) )
} }
...@@ -21,7 +21,7 @@ describe('Cache Components Dev Errors', () => { ...@@ -21,7 +21,7 @@ describe('Cache Components Dev Errors', () => {
// soft-navigating to the page (see test below). // soft-navigating to the page (see test below).
await expect(browser).toDisplayCollapsedRedbox(` await expect(browser).toDisplayCollapsedRedbox(`
{ {
"code": "E1295", "code": "E1432",
"description": "Next.js encountered the unstable value Math.random() while prerendering.", "description": "Next.js encountered the unstable value Math.random() while prerendering.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Blocking Route", "label": "Blocking Route",
...@@ -51,7 +51,7 @@ describe('Cache Components Dev Errors', () => { ...@@ -51,7 +51,7 @@ describe('Cache Components Dev Errors', () => {
// TODO: React should not include the anon stack in the Owner Stack. // TODO: React should not include the anon stack in the Owner Stack.
await expect(browser).toDisplayCollapsedRedbox(` await expect(browser).toDisplayCollapsedRedbox(`
{ {
"code": "E1295", "code": "E1432",
"description": "Next.js encountered the unstable value Math.random() while prerendering.", "description": "Next.js encountered the unstable value Math.random() while prerendering.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Blocking Route", "label": "Blocking Route",
...@@ -98,7 +98,7 @@ describe('Cache Components Dev Errors', () => { ...@@ -98,7 +98,7 @@ describe('Cache Components Dev Errors', () => {
await expect(browser).toDisplayCollapsedRedbox(` await expect(browser).toDisplayCollapsedRedbox(`
{ {
"code": "E1401", "code": "E1440",
"description": "Next.js encountered uncached data during prerendering.", "description": "Next.js encountered uncached data during prerendering.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Blocking Route", "label": "Blocking Route",
......
...@@ -51,7 +51,7 @@ describe('Cache Components Fallback Validation', () => { ...@@ -51,7 +51,7 @@ describe('Cache Components Fallback Validation', () => {
) )
await expect(browser).toDisplayCollapsedRedbox(` await expect(browser).toDisplayCollapsedRedbox(`
{ {
"code": "E1400", "code": "E1427",
"description": "Next.js encountered runtime data during prerendering.", "description": "Next.js encountered runtime data during prerendering.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Blocking Route", "label": "Blocking Route",
...@@ -67,7 +67,7 @@ describe('Cache Components Fallback Validation', () => { ...@@ -67,7 +67,7 @@ describe('Cache Components Fallback Validation', () => {
await browser.loadPage(`${next.url}/partial/prerendered/unwrapped/novel`) await browser.loadPage(`${next.url}/partial/prerendered/unwrapped/novel`)
await expect(browser).toDisplayCollapsedRedbox(` await expect(browser).toDisplayCollapsedRedbox(`
{ {
"code": "E1400", "code": "E1427",
"description": "Next.js encountered runtime data during prerendering.", "description": "Next.js encountered runtime data during prerendering.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Blocking Route", "label": "Blocking Route",
...@@ -83,7 +83,7 @@ describe('Cache Components Fallback Validation', () => { ...@@ -83,7 +83,7 @@ describe('Cache Components Fallback Validation', () => {
await browser.loadPage(`${next.url}/partial/novel/unwrapped/novel`) await browser.loadPage(`${next.url}/partial/novel/unwrapped/novel`)
await expect(browser).toDisplayCollapsedRedbox(` await expect(browser).toDisplayCollapsedRedbox(`
{ {
"code": "E1400", "code": "E1427",
"description": "Next.js encountered runtime data during prerendering.", "description": "Next.js encountered runtime data during prerendering.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Blocking Route", "label": "Blocking Route",
...@@ -103,7 +103,7 @@ describe('Cache Components Fallback Validation', () => { ...@@ -103,7 +103,7 @@ describe('Cache Components Fallback Validation', () => {
const browser = await next.browser('/none/prerendered/wrapped/prerendered') const browser = await next.browser('/none/prerendered/wrapped/prerendered')
await expect(browser).toDisplayCollapsedRedbox(` await expect(browser).toDisplayCollapsedRedbox(`
{ {
"code": "E1400", "code": "E1427",
"description": "Next.js encountered runtime data during prerendering.", "description": "Next.js encountered runtime data during prerendering.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Blocking Route", "label": "Blocking Route",
...@@ -119,7 +119,7 @@ describe('Cache Components Fallback Validation', () => { ...@@ -119,7 +119,7 @@ describe('Cache Components Fallback Validation', () => {
await browser.loadPage(`${next.url}/none/prerendered/wrapped/novel`) await browser.loadPage(`${next.url}/none/prerendered/wrapped/novel`)
await expect(browser).toDisplayCollapsedRedbox(` await expect(browser).toDisplayCollapsedRedbox(`
{ {
"code": "E1400", "code": "E1427",
"description": "Next.js encountered runtime data during prerendering.", "description": "Next.js encountered runtime data during prerendering.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Blocking Route", "label": "Blocking Route",
...@@ -135,7 +135,7 @@ describe('Cache Components Fallback Validation', () => { ...@@ -135,7 +135,7 @@ describe('Cache Components Fallback Validation', () => {
await browser.loadPage(`${next.url}/none/novel/wrapped/novel`) await browser.loadPage(`${next.url}/none/novel/wrapped/novel`)
await expect(browser).toDisplayCollapsedRedbox(` await expect(browser).toDisplayCollapsedRedbox(`
{ {
"code": "E1400", "code": "E1427",
"description": "Next.js encountered runtime data during prerendering.", "description": "Next.js encountered runtime data during prerendering.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Blocking Route", "label": "Blocking Route",
...@@ -151,7 +151,7 @@ describe('Cache Components Fallback Validation', () => { ...@@ -151,7 +151,7 @@ describe('Cache Components Fallback Validation', () => {
await browser.loadPage(`${next.url}/none/prerendered/unwrapped/prerendered`) await browser.loadPage(`${next.url}/none/prerendered/unwrapped/prerendered`)
await expect(browser).toDisplayCollapsedRedbox(` await expect(browser).toDisplayCollapsedRedbox(`
{ {
"code": "E1400", "code": "E1427",
"description": "Next.js encountered runtime data during prerendering.", "description": "Next.js encountered runtime data during prerendering.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Blocking Route", "label": "Blocking Route",
...@@ -167,7 +167,7 @@ describe('Cache Components Fallback Validation', () => { ...@@ -167,7 +167,7 @@ describe('Cache Components Fallback Validation', () => {
await browser.loadPage(`${next.url}/none/prerendered/unwrapped/novel`) await browser.loadPage(`${next.url}/none/prerendered/unwrapped/novel`)
await expect(browser).toDisplayCollapsedRedbox(` await expect(browser).toDisplayCollapsedRedbox(`
{ {
"code": "E1400", "code": "E1427",
"description": "Next.js encountered runtime data during prerendering.", "description": "Next.js encountered runtime data during prerendering.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Blocking Route", "label": "Blocking Route",
...@@ -183,7 +183,7 @@ describe('Cache Components Fallback Validation', () => { ...@@ -183,7 +183,7 @@ describe('Cache Components Fallback Validation', () => {
await browser.loadPage(`${next.url}/none/novel/unwrapped/novel`) await browser.loadPage(`${next.url}/none/novel/unwrapped/novel`)
await expect(browser).toDisplayCollapsedRedbox(` await expect(browser).toDisplayCollapsedRedbox(`
{ {
"code": "E1400", "code": "E1427",
"description": "Next.js encountered runtime data during prerendering.", "description": "Next.js encountered runtime data during prerendering.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Blocking Route", "label": "Blocking Route",
......
...@@ -282,7 +282,7 @@ describe('cache-components-dev-streaming', () => { ...@@ -282,7 +282,7 @@ describe('cache-components-dev-streaming', () => {
// Cold cache miss: validation runs against a separate warm-cache render. // Cold cache miss: validation runs against a separate warm-cache render.
await expect(browser).toDisplayCollapsedRedbox(` await expect(browser).toDisplayCollapsedRedbox(`
{ {
"code": "E1401", "code": "E1440",
"description": "Next.js encountered uncached data during prerendering.", "description": "Next.js encountered uncached data during prerendering.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Blocking Route", "label": "Blocking Route",
...@@ -307,7 +307,7 @@ describe('cache-components-dev-streaming', () => { ...@@ -307,7 +307,7 @@ describe('cache-components-dev-streaming', () => {
// and the cached value is re-served rather than recomputed. // and the cached value is re-served rather than recomputed.
await expect(browser).toDisplayCollapsedRedbox(` await expect(browser).toDisplayCollapsedRedbox(`
{ {
"code": "E1401", "code": "E1440",
"description": "Next.js encountered uncached data during prerendering.", "description": "Next.js encountered uncached data during prerendering.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Blocking Route", "label": "Blocking Route",
...@@ -329,7 +329,7 @@ describe('cache-components-dev-streaming', () => { ...@@ -329,7 +329,7 @@ describe('cache-components-dev-streaming', () => {
// Cold cache miss: validation runs against a separate warm-cache render. // Cold cache miss: validation runs against a separate warm-cache render.
await expect(browser).toDisplayCollapsedRedbox(` await expect(browser).toDisplayCollapsedRedbox(`
{ {
"code": "E1295", "code": "E1432",
"description": "Next.js encountered the unstable value Date() while prerendering.", "description": "Next.js encountered the unstable value Date() while prerendering.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Blocking Route", "label": "Blocking Route",
...@@ -354,7 +354,7 @@ describe('cache-components-dev-streaming', () => { ...@@ -354,7 +354,7 @@ describe('cache-components-dev-streaming', () => {
// and the cached value is re-served rather than recomputed. // and the cached value is re-served rather than recomputed.
await expect(browser).toDisplayCollapsedRedbox(` await expect(browser).toDisplayCollapsedRedbox(`
{ {
"code": "E1295", "code": "E1432",
"description": "Next.js encountered the unstable value Date() while prerendering.", "description": "Next.js encountered the unstable value Date() while prerendering.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Blocking Route", "label": "Blocking Route",
......
...@@ -34,7 +34,7 @@ describe('prefetch-true-partial-warning', () => { ...@@ -34,7 +34,7 @@ describe('prefetch-true-partial-warning', () => {
await expect(browser).toDisplayCollapsedRedbox(` await expect(browser).toDisplayCollapsedRedbox(`
{ {
"code": "E1394", "code": "E1435",
"description": "Next.js encountered dynamic data during prefetching.", "description": "Next.js encountered dynamic data during prefetching.",
"environmentLabel": null, "environmentLabel": null,
"label": "Instant", "label": "Instant",
......
...@@ -42,7 +42,7 @@ export function registerDynamicRootAndBoundaryTests( ...@@ -42,7 +42,7 @@ export function registerDynamicRootAndBoundaryTests(
await expect(browser).toDisplayCollapsedRedbox(` await expect(browser).toDisplayCollapsedRedbox(`
[ [
{ {
"code": "E1401", "code": "E1440",
"description": "Next.js encountered uncached data during prerendering.", "description": "Next.js encountered uncached data during prerendering.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Blocking Route", "label": "Blocking Route",
...@@ -56,7 +56,7 @@ export function registerDynamicRootAndBoundaryTests( ...@@ -56,7 +56,7 @@ export function registerDynamicRootAndBoundaryTests(
], ],
}, },
{ {
"code": "E1401", "code": "E1440",
"description": "Next.js encountered uncached data during prerendering.", "description": "Next.js encountered uncached data during prerendering.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Blocking Route", "label": "Blocking Route",
...@@ -94,11 +94,10 @@ export function registerDynamicRootAndBoundaryTests( ...@@ -94,11 +94,10 @@ export function registerDynamicRootAndBoundaryTests(
Ways to fix this: Ways to fix this:
- [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access - [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access
https://nextjs.org/docs/messages/blocking-prerender-dynamic#wrap-in-or-move-into-suspense
- [cache] For uncached data (\`fetch\`, database calls): cache the access with \`"use cache"\` (does not apply to \`connection()\`) - [cache] For uncached data (\`fetch\`, database calls): cache the access with \`"use cache"\` (does not apply to \`connection()\`)
https://nextjs.org/docs/messages/blocking-prerender-dynamic#cache-the-component-or-data
- [block] Set \`export const instant = false\` to allow a blocking route - [block] Set \`export const instant = false\` to allow a blocking route
https://nextjs.org/docs/messages/blocking-prerender-dynamic#allow-blocking-route
Learn more: https://nextjs.org/docs/messages/blocking-prerender-dynamic
at fetchRandom (app/dynamic-root/page.tsx:62:16) at fetchRandom (app/dynamic-root/page.tsx:62:16)
at FetchingComponent (app/dynamic-root/page.tsx:46:56) at FetchingComponent (app/dynamic-root/page.tsx:46:56)
at Page (app/dynamic-root/page.tsx:23:9) at Page (app/dynamic-root/page.tsx:23:9)
...@@ -116,11 +115,10 @@ export function registerDynamicRootAndBoundaryTests( ...@@ -116,11 +115,10 @@ export function registerDynamicRootAndBoundaryTests(
Ways to fix this: Ways to fix this:
- [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access - [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access
https://nextjs.org/docs/messages/blocking-prerender-dynamic#wrap-in-or-move-into-suspense
- [cache] For uncached data (\`fetch\`, database calls): cache the access with \`"use cache"\` (does not apply to \`connection()\`) - [cache] For uncached data (\`fetch\`, database calls): cache the access with \`"use cache"\` (does not apply to \`connection()\`)
https://nextjs.org/docs/messages/blocking-prerender-dynamic#cache-the-component-or-data
- [block] Set \`export const instant = false\` to allow a blocking route - [block] Set \`export const instant = false\` to allow a blocking route
https://nextjs.org/docs/messages/blocking-prerender-dynamic#allow-blocking-route
Learn more: https://nextjs.org/docs/messages/blocking-prerender-dynamic
at fetchRandom (app/dynamic-root/page.tsx:62:16) at fetchRandom (app/dynamic-root/page.tsx:62:16)
at FetchingComponent (app/dynamic-root/page.tsx:46:56) at FetchingComponent (app/dynamic-root/page.tsx:46:56)
at Page (app/dynamic-root/page.tsx:28:7) at Page (app/dynamic-root/page.tsx:28:7)
...@@ -145,11 +143,10 @@ export function registerDynamicRootAndBoundaryTests( ...@@ -145,11 +143,10 @@ export function registerDynamicRootAndBoundaryTests(
Ways to fix this: Ways to fix this:
- [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access - [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access
https://nextjs.org/docs/messages/blocking-prerender-dynamic#wrap-in-or-move-into-suspense
- [cache] For uncached data (\`fetch\`, database calls): cache the access with \`"use cache"\` (does not apply to \`connection()\`) - [cache] For uncached data (\`fetch\`, database calls): cache the access with \`"use cache"\` (does not apply to \`connection()\`)
https://nextjs.org/docs/messages/blocking-prerender-dynamic#cache-the-component-or-data
- [block] Set \`export const instant = false\` to allow a blocking route - [block] Set \`export const instant = false\` to allow a blocking route
https://nextjs.org/docs/messages/blocking-prerender-dynamic#allow-blocking-route
Learn more: https://nextjs.org/docs/messages/blocking-prerender-dynamic
at <unknown> (app/dynamic-root/indirection.tsx:7:34) at <unknown> (app/dynamic-root/indirection.tsx:7:34)
at main (<anonymous>) at main (<anonymous>)
at body (<anonymous>) at body (<anonymous>)
...@@ -170,11 +167,10 @@ export function registerDynamicRootAndBoundaryTests( ...@@ -170,11 +167,10 @@ export function registerDynamicRootAndBoundaryTests(
Ways to fix this: Ways to fix this:
- [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access - [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access
https://nextjs.org/docs/messages/blocking-prerender-dynamic#wrap-in-or-move-into-suspense
- [cache] For uncached data (\`fetch\`, database calls): cache the access with \`"use cache"\` (does not apply to \`connection()\`) - [cache] For uncached data (\`fetch\`, database calls): cache the access with \`"use cache"\` (does not apply to \`connection()\`)
https://nextjs.org/docs/messages/blocking-prerender-dynamic#cache-the-component-or-data
- [block] Set \`export const instant = false\` to allow a blocking route - [block] Set \`export const instant = false\` to allow a blocking route
https://nextjs.org/docs/messages/blocking-prerender-dynamic#allow-blocking-route
Learn more: https://nextjs.org/docs/messages/blocking-prerender-dynamic
at main (<anonymous>) at main (<anonymous>)
at body (<anonymous>) at body (<anonymous>)
at html (<anonymous>) at html (<anonymous>)
...@@ -194,11 +190,10 @@ export function registerDynamicRootAndBoundaryTests( ...@@ -194,11 +190,10 @@ export function registerDynamicRootAndBoundaryTests(
Ways to fix this: Ways to fix this:
- [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access - [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access
https://nextjs.org/docs/messages/blocking-prerender-dynamic#wrap-in-or-move-into-suspense
- [cache] For uncached data (\`fetch\`, database calls): cache the access with \`"use cache"\` (does not apply to \`connection()\`) - [cache] For uncached data (\`fetch\`, database calls): cache the access with \`"use cache"\` (does not apply to \`connection()\`)
https://nextjs.org/docs/messages/blocking-prerender-dynamic#cache-the-component-or-data
- [block] Set \`export const instant = false\` to allow a blocking route - [block] Set \`export const instant = false\` to allow a blocking route
https://nextjs.org/docs/messages/blocking-prerender-dynamic#allow-blocking-route
Learn more: https://nextjs.org/docs/messages/blocking-prerender-dynamic
at fetchRandom (webpack:///app/dynamic-root/page.tsx:62:16) at fetchRandom (webpack:///app/dynamic-root/page.tsx:62:16)
at FetchingComponent (webpack:///app/dynamic-root/page.tsx:46:56) at FetchingComponent (webpack:///app/dynamic-root/page.tsx:46:56)
at Page (webpack:///app/dynamic-root/page.tsx:23:9) at Page (webpack:///app/dynamic-root/page.tsx:23:9)
...@@ -216,11 +211,10 @@ export function registerDynamicRootAndBoundaryTests( ...@@ -216,11 +211,10 @@ export function registerDynamicRootAndBoundaryTests(
Ways to fix this: Ways to fix this:
- [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access - [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access
https://nextjs.org/docs/messages/blocking-prerender-dynamic#wrap-in-or-move-into-suspense
- [cache] For uncached data (\`fetch\`, database calls): cache the access with \`"use cache"\` (does not apply to \`connection()\`) - [cache] For uncached data (\`fetch\`, database calls): cache the access with \`"use cache"\` (does not apply to \`connection()\`)
https://nextjs.org/docs/messages/blocking-prerender-dynamic#cache-the-component-or-data
- [block] Set \`export const instant = false\` to allow a blocking route - [block] Set \`export const instant = false\` to allow a blocking route
https://nextjs.org/docs/messages/blocking-prerender-dynamic#allow-blocking-route
Learn more: https://nextjs.org/docs/messages/blocking-prerender-dynamic
at fetchRandom (webpack:///app/dynamic-root/page.tsx:62:16) at fetchRandom (webpack:///app/dynamic-root/page.tsx:62:16)
at FetchingComponent (webpack:///app/dynamic-root/page.tsx:46:56) at FetchingComponent (webpack:///app/dynamic-root/page.tsx:46:56)
at Page (webpack:///app/dynamic-root/page.tsx:28:7) at Page (webpack:///app/dynamic-root/page.tsx:28:7)
...@@ -245,11 +239,10 @@ export function registerDynamicRootAndBoundaryTests( ...@@ -245,11 +239,10 @@ export function registerDynamicRootAndBoundaryTests(
Ways to fix this: Ways to fix this:
- [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access - [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access
https://nextjs.org/docs/messages/blocking-prerender-dynamic#wrap-in-or-move-into-suspense
- [cache] For uncached data (\`fetch\`, database calls): cache the access with \`"use cache"\` (does not apply to \`connection()\`) - [cache] For uncached data (\`fetch\`, database calls): cache the access with \`"use cache"\` (does not apply to \`connection()\`)
https://nextjs.org/docs/messages/blocking-prerender-dynamic#cache-the-component-or-data
- [block] Set \`export const instant = false\` to allow a blocking route - [block] Set \`export const instant = false\` to allow a blocking route
https://nextjs.org/docs/messages/blocking-prerender-dynamic#allow-blocking-route
Learn more: https://nextjs.org/docs/messages/blocking-prerender-dynamic
at a (<next-dist-dir>) at a (<next-dist-dir>)
at b (<next-dist-dir>) at b (<next-dist-dir>)
at c (<next-dist-dir>) at c (<next-dist-dir>)
...@@ -284,11 +277,10 @@ export function registerDynamicRootAndBoundaryTests( ...@@ -284,11 +277,10 @@ export function registerDynamicRootAndBoundaryTests(
Ways to fix this: Ways to fix this:
- [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access - [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access
https://nextjs.org/docs/messages/blocking-prerender-dynamic#wrap-in-or-move-into-suspense
- [cache] For uncached data (\`fetch\`, database calls): cache the access with \`"use cache"\` (does not apply to \`connection()\`) - [cache] For uncached data (\`fetch\`, database calls): cache the access with \`"use cache"\` (does not apply to \`connection()\`)
https://nextjs.org/docs/messages/blocking-prerender-dynamic#cache-the-component-or-data
- [block] Set \`export const instant = false\` to allow a blocking route - [block] Set \`export const instant = false\` to allow a blocking route
https://nextjs.org/docs/messages/blocking-prerender-dynamic#allow-blocking-route
Learn more: https://nextjs.org/docs/messages/blocking-prerender-dynamic
at w (<next-dist-dir>) at w (<next-dist-dir>)
at x (<next-dist-dir>) at x (<next-dist-dir>)
at y (<next-dist-dir>) at y (<next-dist-dir>)
......
...@@ -25,7 +25,7 @@ export function registerSyncDynamicTests(ctx: CacheComponentsErrorsContext) { ...@@ -25,7 +25,7 @@ export function registerSyncDynamicTests(ctx: CacheComponentsErrorsContext) {
await expect(browser).toDisplayCollapsedRedbox(` await expect(browser).toDisplayCollapsedRedbox(`
{ {
"code": "E1295", "code": "E1432",
"description": "Next.js encountered the unstable value Math.random() while prerendering.", "description": "Next.js encountered the unstable value Math.random() while prerendering.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Blocking Route", "label": "Blocking Route",
...@@ -61,11 +61,10 @@ export function registerSyncDynamicTests(ctx: CacheComponentsErrorsContext) { ...@@ -61,11 +61,10 @@ export function registerSyncDynamicTests(ctx: CacheComponentsErrorsContext) {
Ways to fix this: Ways to fix this:
- [dynamic] Render at request time by adding a dynamic data access (e.g. \`await connection()\`) before this call - [dynamic] Render at request time by adding a dynamic data access (e.g. \`await connection()\`) before this call
https://nextjs.org/docs/messages/blocking-prerender-random#generate-on-every-request
- [cache] Prerender and cache the value with \`"use cache"\` - [cache] Prerender and cache the value with \`"use cache"\`
https://nextjs.org/docs/messages/blocking-prerender-random#cache-the-random-value
- [client] Render the value on the client with \`"use client"\` - [client] Render the value on the client with \`"use client"\`
https://nextjs.org/docs/messages/blocking-prerender-random#render-on-the-client
Learn more: https://nextjs.org/docs/messages/blocking-prerender-random
at RandomReadingComponent (app/sync-random-with-fallback/page.tsx:37:23) at RandomReadingComponent (app/sync-random-with-fallback/page.tsx:37:23)
at Page (app/sync-random-with-fallback/page.tsx:18:11) at Page (app/sync-random-with-fallback/page.tsx:18:11)
35 | use(new Promise((r) => process.nextTick(r))) 35 | use(new Promise((r) => process.nextTick(r)))
...@@ -89,11 +88,10 @@ export function registerSyncDynamicTests(ctx: CacheComponentsErrorsContext) { ...@@ -89,11 +88,10 @@ export function registerSyncDynamicTests(ctx: CacheComponentsErrorsContext) {
Ways to fix this: Ways to fix this:
- [dynamic] Render at request time by adding a dynamic data access (e.g. \`await connection()\`) before this call - [dynamic] Render at request time by adding a dynamic data access (e.g. \`await connection()\`) before this call
https://nextjs.org/docs/messages/blocking-prerender-random#generate-on-every-request
- [cache] Prerender and cache the value with \`"use cache"\` - [cache] Prerender and cache the value with \`"use cache"\`
https://nextjs.org/docs/messages/blocking-prerender-random#cache-the-random-value
- [client] Render the value on the client with \`"use client"\` - [client] Render the value on the client with \`"use client"\`
https://nextjs.org/docs/messages/blocking-prerender-random#render-on-the-client
Learn more: https://nextjs.org/docs/messages/blocking-prerender-random
at RandomReadingComponent (webpack:///app/sync-random-with-fallback/page.tsx:37:23) at RandomReadingComponent (webpack:///app/sync-random-with-fallback/page.tsx:37:23)
at Page (webpack:///app/sync-random-with-fallback/page.tsx:18:11) at Page (webpack:///app/sync-random-with-fallback/page.tsx:18:11)
35 | use(new Promise((r) => process.nextTick(r))) 35 | use(new Promise((r) => process.nextTick(r)))
...@@ -119,11 +117,10 @@ export function registerSyncDynamicTests(ctx: CacheComponentsErrorsContext) { ...@@ -119,11 +117,10 @@ export function registerSyncDynamicTests(ctx: CacheComponentsErrorsContext) {
Ways to fix this: Ways to fix this:
- [dynamic] Render at request time by adding a dynamic data access (e.g. \`await connection()\`) before this call - [dynamic] Render at request time by adding a dynamic data access (e.g. \`await connection()\`) before this call
https://nextjs.org/docs/messages/blocking-prerender-random#generate-on-every-request
- [cache] Prerender and cache the value with \`"use cache"\` - [cache] Prerender and cache the value with \`"use cache"\`
https://nextjs.org/docs/messages/blocking-prerender-random#cache-the-random-value
- [client] Render the value on the client with \`"use client"\` - [client] Render the value on the client with \`"use client"\`
https://nextjs.org/docs/messages/blocking-prerender-random#render-on-the-client
Learn more: https://nextjs.org/docs/messages/blocking-prerender-random
at a (app/sync-random-with-fallback/page.tsx:37:23) at a (app/sync-random-with-fallback/page.tsx:37:23)
35 | use(new Promise((r) => process.nextTick(r))) 35 | use(new Promise((r) => process.nextTick(r)))
36 | } 36 | }
...@@ -146,11 +143,10 @@ export function registerSyncDynamicTests(ctx: CacheComponentsErrorsContext) { ...@@ -146,11 +143,10 @@ export function registerSyncDynamicTests(ctx: CacheComponentsErrorsContext) {
Ways to fix this: Ways to fix this:
- [dynamic] Render at request time by adding a dynamic data access (e.g. \`await connection()\`) before this call - [dynamic] Render at request time by adding a dynamic data access (e.g. \`await connection()\`) before this call
https://nextjs.org/docs/messages/blocking-prerender-random#generate-on-every-request
- [cache] Prerender and cache the value with \`"use cache"\` - [cache] Prerender and cache the value with \`"use cache"\`
https://nextjs.org/docs/messages/blocking-prerender-random#cache-the-random-value
- [client] Render the value on the client with \`"use client"\` - [client] Render the value on the client with \`"use client"\`
https://nextjs.org/docs/messages/blocking-prerender-random#render-on-the-client
Learn more: https://nextjs.org/docs/messages/blocking-prerender-random
at a (<next-dist-dir>) at a (<next-dist-dir>)
To get a more detailed stack trace and pinpoint the issue, try one of the following: 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 "/sync-random-with-fallback" in your browser to investigate the error. - Start the app in development mode by running \`next dev\`, then open "/sync-random-with-fallback" in your browser to investigate the error.
...@@ -177,7 +173,7 @@ export function registerSyncDynamicTests(ctx: CacheComponentsErrorsContext) { ...@@ -177,7 +173,7 @@ export function registerSyncDynamicTests(ctx: CacheComponentsErrorsContext) {
await expect(browser).toDisplayCollapsedRedbox(` await expect(browser).toDisplayCollapsedRedbox(`
{ {
"code": "E1295", "code": "E1432",
"description": "Next.js encountered the unstable value Math.random() while prerendering.", "description": "Next.js encountered the unstable value Math.random() while prerendering.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Blocking Route", "label": "Blocking Route",
...@@ -214,11 +210,10 @@ export function registerSyncDynamicTests(ctx: CacheComponentsErrorsContext) { ...@@ -214,11 +210,10 @@ export function registerSyncDynamicTests(ctx: CacheComponentsErrorsContext) {
Ways to fix this: Ways to fix this:
- [dynamic] Render at request time by adding a dynamic data access (e.g. \`await connection()\`) before this call - [dynamic] Render at request time by adding a dynamic data access (e.g. \`await connection()\`) before this call
https://nextjs.org/docs/messages/blocking-prerender-random#generate-on-every-request
- [cache] Prerender and cache the value with \`"use cache"\` - [cache] Prerender and cache the value with \`"use cache"\`
https://nextjs.org/docs/messages/blocking-prerender-random#cache-the-random-value
- [client] Render the value on the client with \`"use client"\` - [client] Render the value on the client with \`"use client"\`
https://nextjs.org/docs/messages/blocking-prerender-random#render-on-the-client
Learn more: https://nextjs.org/docs/messages/blocking-prerender-random
at getRandomNumber (app/sync-random-without-fallback/page.tsx:32:15) at getRandomNumber (app/sync-random-without-fallback/page.tsx:32:15)
at RandomReadingComponent (app/sync-random-without-fallback/page.tsx:40:18) at RandomReadingComponent (app/sync-random-without-fallback/page.tsx:40:18)
at Page (app/sync-random-without-fallback/page.tsx:18:11) at Page (app/sync-random-without-fallback/page.tsx:18:11)
...@@ -243,11 +238,10 @@ export function registerSyncDynamicTests(ctx: CacheComponentsErrorsContext) { ...@@ -243,11 +238,10 @@ export function registerSyncDynamicTests(ctx: CacheComponentsErrorsContext) {
Ways to fix this: Ways to fix this:
- [dynamic] Render at request time by adding a dynamic data access (e.g. \`await connection()\`) before this call - [dynamic] Render at request time by adding a dynamic data access (e.g. \`await connection()\`) before this call
https://nextjs.org/docs/messages/blocking-prerender-random#generate-on-every-request
- [cache] Prerender and cache the value with \`"use cache"\` - [cache] Prerender and cache the value with \`"use cache"\`
https://nextjs.org/docs/messages/blocking-prerender-random#cache-the-random-value
- [client] Render the value on the client with \`"use client"\` - [client] Render the value on the client with \`"use client"\`
https://nextjs.org/docs/messages/blocking-prerender-random#render-on-the-client
Learn more: https://nextjs.org/docs/messages/blocking-prerender-random
at getRandomNumber (webpack:///app/sync-random-without-fallback/page.tsx:32:15) at getRandomNumber (webpack:///app/sync-random-without-fallback/page.tsx:32:15)
at RandomReadingComponent (webpack:///app/sync-random-without-fallback/page.tsx:40:18) at RandomReadingComponent (webpack:///app/sync-random-without-fallback/page.tsx:40:18)
at Page (webpack:///app/sync-random-without-fallback/page.tsx:18:11) at Page (webpack:///app/sync-random-without-fallback/page.tsx:18:11)
...@@ -274,11 +268,10 @@ export function registerSyncDynamicTests(ctx: CacheComponentsErrorsContext) { ...@@ -274,11 +268,10 @@ export function registerSyncDynamicTests(ctx: CacheComponentsErrorsContext) {
Ways to fix this: Ways to fix this:
- [dynamic] Render at request time by adding a dynamic data access (e.g. \`await connection()\`) before this call - [dynamic] Render at request time by adding a dynamic data access (e.g. \`await connection()\`) before this call
https://nextjs.org/docs/messages/blocking-prerender-random#generate-on-every-request
- [cache] Prerender and cache the value with \`"use cache"\` - [cache] Prerender and cache the value with \`"use cache"\`
https://nextjs.org/docs/messages/blocking-prerender-random#cache-the-random-value
- [client] Render the value on the client with \`"use client"\` - [client] Render the value on the client with \`"use client"\`
https://nextjs.org/docs/messages/blocking-prerender-random#render-on-the-client
Learn more: https://nextjs.org/docs/messages/blocking-prerender-random
at a (app/sync-random-without-fallback/page.tsx:32:15) at a (app/sync-random-without-fallback/page.tsx:32:15)
30 | 30 |
31 | function getRandomNumber() { 31 | function getRandomNumber() {
...@@ -301,11 +294,10 @@ export function registerSyncDynamicTests(ctx: CacheComponentsErrorsContext) { ...@@ -301,11 +294,10 @@ export function registerSyncDynamicTests(ctx: CacheComponentsErrorsContext) {
Ways to fix this: Ways to fix this:
- [dynamic] Render at request time by adding a dynamic data access (e.g. \`await connection()\`) before this call - [dynamic] Render at request time by adding a dynamic data access (e.g. \`await connection()\`) before this call
https://nextjs.org/docs/messages/blocking-prerender-random#generate-on-every-request
- [cache] Prerender and cache the value with \`"use cache"\` - [cache] Prerender and cache the value with \`"use cache"\`
https://nextjs.org/docs/messages/blocking-prerender-random#cache-the-random-value
- [client] Render the value on the client with \`"use client"\` - [client] Render the value on the client with \`"use client"\`
https://nextjs.org/docs/messages/blocking-prerender-random#render-on-the-client
Learn more: https://nextjs.org/docs/messages/blocking-prerender-random
at a (<next-dist-dir>) at a (<next-dist-dir>)
To get a more detailed stack trace and pinpoint the issue, try one of the following: 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 "/sync-random-without-fallback" in your browser to investigate the error. - Start the app in development mode by running \`next dev\`, then open "/sync-random-without-fallback" in your browser to investigate the error.
......
...@@ -277,7 +277,7 @@ export function registerUseCachePrivateTests( ...@@ -277,7 +277,7 @@ export function registerUseCachePrivateTests(
await expect(browser).toDisplayCollapsedRedbox(` await expect(browser).toDisplayCollapsedRedbox(`
{ {
"code": "E1400", "code": "E1427",
"description": "Next.js encountered runtime data during prerendering.", "description": "Next.js encountered runtime data during prerendering.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Blocking Route", "label": "Blocking Route",
...@@ -313,11 +313,10 @@ export function registerUseCachePrivateTests( ...@@ -313,11 +313,10 @@ export function registerUseCachePrivateTests(
Ways to fix this: Ways to fix this:
- [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access - [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access
https://nextjs.org/docs/messages/blocking-prerender-dynamic#wrap-in-or-move-into-suspense
- [cache] For uncached data (\`fetch\`, database calls): cache the access with \`"use cache"\` (does not apply to \`connection()\`) - [cache] For uncached data (\`fetch\`, database calls): cache the access with \`"use cache"\` (does not apply to \`connection()\`)
https://nextjs.org/docs/messages/blocking-prerender-dynamic#cache-the-component-or-data
- [block] Set \`export const instant = false\` to allow a blocking route - [block] Set \`export const instant = false\` to allow a blocking route
https://nextjs.org/docs/messages/blocking-prerender-dynamic#allow-blocking-route
Learn more: https://nextjs.org/docs/messages/blocking-prerender-dynamic
at Private (app/use-cache-private-without-suspense/page.tsx:15:1) at Private (app/use-cache-private-without-suspense/page.tsx:15:1)
at Page (app/use-cache-private-without-suspense/page.tsx:10:7) at Page (app/use-cache-private-without-suspense/page.tsx:10:7)
13 | } 13 | }
...@@ -341,11 +340,10 @@ export function registerUseCachePrivateTests( ...@@ -341,11 +340,10 @@ export function registerUseCachePrivateTests(
Ways to fix this: Ways to fix this:
- [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access - [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access
https://nextjs.org/docs/messages/blocking-prerender-dynamic#wrap-in-or-move-into-suspense
- [cache] For uncached data (\`fetch\`, database calls): cache the access with \`"use cache"\` (does not apply to \`connection()\`) - [cache] For uncached data (\`fetch\`, database calls): cache the access with \`"use cache"\` (does not apply to \`connection()\`)
https://nextjs.org/docs/messages/blocking-prerender-dynamic#cache-the-component-or-data
- [block] Set \`export const instant = false\` to allow a blocking route - [block] Set \`export const instant = false\` to allow a blocking route
https://nextjs.org/docs/messages/blocking-prerender-dynamic#allow-blocking-route
Learn more: https://nextjs.org/docs/messages/blocking-prerender-dynamic
at main (<anonymous>) at main (<anonymous>)
at body (<anonymous>) at body (<anonymous>)
at html (<anonymous>) at html (<anonymous>)
...@@ -368,11 +366,10 @@ export function registerUseCachePrivateTests( ...@@ -368,11 +366,10 @@ export function registerUseCachePrivateTests(
Ways to fix this: Ways to fix this:
- [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access - [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access
https://nextjs.org/docs/messages/blocking-prerender-dynamic#wrap-in-or-move-into-suspense
- [cache] For uncached data (\`fetch\`, database calls): cache the access with \`"use cache"\` (does not apply to \`connection()\`) - [cache] For uncached data (\`fetch\`, database calls): cache the access with \`"use cache"\` (does not apply to \`connection()\`)
https://nextjs.org/docs/messages/blocking-prerender-dynamic#cache-the-component-or-data
- [block] Set \`export const instant = false\` to allow a blocking route - [block] Set \`export const instant = false\` to allow a blocking route
https://nextjs.org/docs/messages/blocking-prerender-dynamic#allow-blocking-route`
Learn more: https://nextjs.org/docs/messages/blocking-prerender-dynamic`
) )
} else { } else {
expect(output).toMatchInlineSnapshot(` expect(output).toMatchInlineSnapshot(`
...@@ -382,11 +379,10 @@ Ways to fix this: ...@@ -382,11 +379,10 @@ Ways to fix this:
Ways to fix this: Ways to fix this:
- [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access - [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access
https://nextjs.org/docs/messages/blocking-prerender-dynamic#wrap-in-or-move-into-suspense
- [cache] For uncached data (\`fetch\`, database calls): cache the access with \`"use cache"\` (does not apply to \`connection()\`) - [cache] For uncached data (\`fetch\`, database calls): cache the access with \`"use cache"\` (does not apply to \`connection()\`)
https://nextjs.org/docs/messages/blocking-prerender-dynamic#cache-the-component-or-data
- [block] Set \`export const instant = false\` to allow a blocking route - [block] Set \`export const instant = false\` to allow a blocking route
https://nextjs.org/docs/messages/blocking-prerender-dynamic#allow-blocking-route
Learn more: https://nextjs.org/docs/messages/blocking-prerender-dynamic
at a (<next-dist-dir>) at a (<next-dist-dir>)
at b (<next-dist-dir>) at b (<next-dist-dir>)
at c (<next-dist-dir>) at c (<next-dist-dir>)
......
...@@ -70,11 +70,10 @@ describe('instant-validation-build', () => { ...@@ -70,11 +70,10 @@ describe('instant-validation-build', () => {
Ways to fix this: Ways to fix this:
- [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access - [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access
https://nextjs.org/docs/messages/blocking-prerender-dynamic#wrap-in-or-move-into-suspense
- [cache] Cache the data access with \`"use cache"\` (does not apply to \`connection()\`) - [cache] Cache the data access with \`"use cache"\` (does not apply to \`connection()\`)
https://nextjs.org/docs/messages/blocking-prerender-dynamic#cache-the-component-or-data
- [block] Set \`export const instant = false\` to allow a blocking route - [block] Set \`export const instant = false\` to allow a blocking route
https://nextjs.org/docs/messages/blocking-prerender-dynamic#allow-blocking-route
Learn more: https://nextjs.org/docs/messages/blocking-prerender-dynamic
at main (<anonymous>) at main (<anonymous>)
at body (<anonymous>) at body (<anonymous>)
at html (<anonymous>) at html (<anonymous>)
......
...@@ -105,7 +105,7 @@ describe('instant validation causes', () => { ...@@ -105,7 +105,7 @@ describe('instant validation causes', () => {
], ],
}, },
], ],
"code": "E1398", "code": "E1437",
"description": "Next.js encountered uncached data during a navigation.", "description": "Next.js encountered uncached data during a navigation.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Instant", "label": "Instant",
...@@ -136,7 +136,7 @@ describe('instant validation causes', () => { ...@@ -136,7 +136,7 @@ describe('instant validation causes', () => {
], ],
}, },
], ],
"code": "E1398", "code": "E1437",
"description": "Next.js encountered uncached data during a navigation.", "description": "Next.js encountered uncached data during a navigation.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Instant", "label": "Instant",
...@@ -167,7 +167,7 @@ describe('instant validation causes', () => { ...@@ -167,7 +167,7 @@ describe('instant validation causes', () => {
], ],
}, },
], ],
"code": "E1398", "code": "E1437",
"description": "Next.js encountered uncached data during a navigation.", "description": "Next.js encountered uncached data during a navigation.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Instant", "label": "Instant",
...@@ -201,7 +201,7 @@ describe('instant validation causes', () => { ...@@ -201,7 +201,7 @@ describe('instant validation causes', () => {
], ],
}, },
], ],
"code": "E1398", "code": "E1437",
"description": "Next.js encountered uncached data during a navigation.", "description": "Next.js encountered uncached data during a navigation.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Instant", "label": "Instant",
......
...@@ -57,7 +57,7 @@ describe('instant validation - default level', () => { ...@@ -57,7 +57,7 @@ describe('instant validation - default level', () => {
const browser = await next.browser('/bare') const browser = await next.browser('/bare')
await expect(browser).toDisplayCollapsedRedbox(` await expect(browser).toDisplayCollapsedRedbox(`
{ {
"code": "E1398", "code": "E1437",
"description": "Next.js encountered uncached data during a navigation.", "description": "Next.js encountered uncached data during a navigation.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Instant", "label": "Instant",
......
...@@ -60,7 +60,7 @@ describe('instant validation - level error', () => { ...@@ -60,7 +60,7 @@ describe('instant validation - level error', () => {
const browser = await next.browser('/bare') const browser = await next.browser('/bare')
await expect(browser).toDisplayCollapsedRedbox(` await expect(browser).toDisplayCollapsedRedbox(`
{ {
"code": "E1398", "code": "E1437",
"description": "Next.js encountered uncached data during a navigation.", "description": "Next.js encountered uncached data during a navigation.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Instant", "label": "Instant",
...@@ -90,7 +90,7 @@ describe('instant validation - level error', () => { ...@@ -90,7 +90,7 @@ describe('instant validation - level error', () => {
], ],
}, },
], ],
"code": "E1398", "code": "E1437",
"description": "Next.js encountered uncached data during a navigation.", "description": "Next.js encountered uncached data during a navigation.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Instant", "label": "Instant",
...@@ -120,7 +120,7 @@ describe('instant validation - level error', () => { ...@@ -120,7 +120,7 @@ describe('instant validation - level error', () => {
], ],
}, },
], ],
"code": "E1398", "code": "E1437",
"description": "Next.js encountered uncached data during a navigation.", "description": "Next.js encountered uncached data during a navigation.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Instant", "label": "Instant",
...@@ -150,7 +150,7 @@ describe('instant validation - level error', () => { ...@@ -150,7 +150,7 @@ describe('instant validation - level error', () => {
], ],
}, },
], ],
"code": "E1398", "code": "E1437",
"description": "Next.js encountered uncached data during a navigation.", "description": "Next.js encountered uncached data during a navigation.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Instant", "label": "Instant",
...@@ -177,7 +177,7 @@ describe('instant validation - level error', () => { ...@@ -177,7 +177,7 @@ describe('instant validation - level error', () => {
const browser = await next.browser('/layered') const browser = await next.browser('/layered')
await expect(browser).toDisplayCollapsedRedbox(` await expect(browser).toDisplayCollapsedRedbox(`
{ {
"code": "E1398", "code": "E1437",
"description": "Next.js encountered uncached data during a navigation.", "description": "Next.js encountered uncached data during a navigation.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Instant", "label": "Instant",
...@@ -203,11 +203,10 @@ describe('instant validation - level error', () => { ...@@ -203,11 +203,10 @@ describe('instant validation - level error', () => {
Ways to fix this: Ways to fix this:
- [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access - [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access
https://nextjs.org/docs/messages/blocking-prerender-dynamic#wrap-in-or-move-into-suspense
- [cache] Cache the data access with \`"use cache"\` (does not apply to \`connection()\`) - [cache] Cache the data access with \`"use cache"\` (does not apply to \`connection()\`)
https://nextjs.org/docs/messages/blocking-prerender-dynamic#cache-the-component-or-data
- [block] Set \`export const instant = false\` to allow a blocking route - [block] Set \`export const instant = false\` to allow a blocking route
https://nextjs.org/docs/messages/blocking-prerender-dynamic#allow-blocking-route
Learn more: https://nextjs.org/docs/messages/blocking-prerender-dynamic
at a (<anonymous>) at a (<anonymous>)
at body (<anonymous>) at body (<anonymous>)
at html (<anonymous>) at html (<anonymous>)
...@@ -230,11 +229,10 @@ describe('instant validation - level error', () => { ...@@ -230,11 +229,10 @@ describe('instant validation - level error', () => {
Ways to fix this: Ways to fix this:
- [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access - [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access
https://nextjs.org/docs/messages/blocking-prerender-dynamic#wrap-in-or-move-into-suspense
- [cache] Cache the data access with \`"use cache"\` (does not apply to \`connection()\`) - [cache] Cache the data access with \`"use cache"\` (does not apply to \`connection()\`)
https://nextjs.org/docs/messages/blocking-prerender-dynamic#cache-the-component-or-data
- [block] Set \`export const instant = false\` to allow a blocking route - [block] Set \`export const instant = false\` to allow a blocking route
https://nextjs.org/docs/messages/blocking-prerender-dynamic#allow-blocking-route
Learn more: https://nextjs.org/docs/messages/blocking-prerender-dynamic
at a (<anonymous>) at a (<anonymous>)
at body (<anonymous>) at body (<anonymous>)
at html (<anonymous>) at html (<anonymous>)
...@@ -257,11 +255,10 @@ describe('instant validation - level error', () => { ...@@ -257,11 +255,10 @@ describe('instant validation - level error', () => {
Ways to fix this: Ways to fix this:
- [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access - [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access
https://nextjs.org/docs/messages/blocking-prerender-dynamic#wrap-in-or-move-into-suspense
- [cache] Cache the data access with \`"use cache"\` (does not apply to \`connection()\`) - [cache] Cache the data access with \`"use cache"\` (does not apply to \`connection()\`)
https://nextjs.org/docs/messages/blocking-prerender-dynamic#cache-the-component-or-data
- [block] Set \`export const instant = false\` to allow a blocking route - [block] Set \`export const instant = false\` to allow a blocking route
https://nextjs.org/docs/messages/blocking-prerender-dynamic#allow-blocking-route
Learn more: https://nextjs.org/docs/messages/blocking-prerender-dynamic
at a (<anonymous>) at a (<anonymous>)
at body (<anonymous>) at body (<anonymous>)
at html (<anonymous>) at html (<anonymous>)
...@@ -297,11 +294,10 @@ describe('instant validation - level error', () => { ...@@ -297,11 +294,10 @@ describe('instant validation - level error', () => {
Ways to fix this: Ways to fix this:
- [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access - [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access
https://nextjs.org/docs/messages/blocking-prerender-dynamic#wrap-in-or-move-into-suspense
- [cache] Cache the data access with \`"use cache"\` (does not apply to \`connection()\`) - [cache] Cache the data access with \`"use cache"\` (does not apply to \`connection()\`)
https://nextjs.org/docs/messages/blocking-prerender-dynamic#cache-the-component-or-data
- [block] Set \`export const instant = false\` to allow a blocking route - [block] Set \`export const instant = false\` to allow a blocking route
https://nextjs.org/docs/messages/blocking-prerender-dynamic#allow-blocking-route
Learn more: https://nextjs.org/docs/messages/blocking-prerender-dynamic
at a (<anonymous>) at a (<anonymous>)
at body (<anonymous>) at body (<anonymous>)
at html (<anonymous>) at html (<anonymous>)
......
...@@ -79,7 +79,7 @@ describe('instant validation - level manual-error', () => { ...@@ -79,7 +79,7 @@ describe('instant validation - level manual-error', () => {
], ],
}, },
], ],
"code": "E1398", "code": "E1437",
"description": "Next.js encountered uncached data during a navigation.", "description": "Next.js encountered uncached data during a navigation.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Instant", "label": "Instant",
...@@ -109,7 +109,7 @@ describe('instant validation - level manual-error', () => { ...@@ -109,7 +109,7 @@ describe('instant validation - level manual-error', () => {
], ],
}, },
], ],
"code": "E1398", "code": "E1437",
"description": "Next.js encountered uncached data during a navigation.", "description": "Next.js encountered uncached data during a navigation.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Instant", "label": "Instant",
...@@ -139,7 +139,7 @@ describe('instant validation - level manual-error', () => { ...@@ -139,7 +139,7 @@ describe('instant validation - level manual-error', () => {
], ],
}, },
], ],
"code": "E1398", "code": "E1437",
"description": "Next.js encountered uncached data during a navigation.", "description": "Next.js encountered uncached data during a navigation.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Instant", "label": "Instant",
...@@ -186,11 +186,10 @@ describe('instant validation - level manual-error', () => { ...@@ -186,11 +186,10 @@ describe('instant validation - level manual-error', () => {
Ways to fix this: Ways to fix this:
- [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access - [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access
https://nextjs.org/docs/messages/blocking-prerender-dynamic#wrap-in-or-move-into-suspense
- [cache] Cache the data access with \`"use cache"\` (does not apply to \`connection()\`) - [cache] Cache the data access with \`"use cache"\` (does not apply to \`connection()\`)
https://nextjs.org/docs/messages/blocking-prerender-dynamic#cache-the-component-or-data
- [block] Set \`export const instant = false\` to allow a blocking route - [block] Set \`export const instant = false\` to allow a blocking route
https://nextjs.org/docs/messages/blocking-prerender-dynamic#allow-blocking-route
Learn more: https://nextjs.org/docs/messages/blocking-prerender-dynamic
at a (<anonymous>) at a (<anonymous>)
at body (<anonymous>) at body (<anonymous>)
at html (<anonymous>) at html (<anonymous>)
...@@ -213,11 +212,10 @@ describe('instant validation - level manual-error', () => { ...@@ -213,11 +212,10 @@ describe('instant validation - level manual-error', () => {
Ways to fix this: Ways to fix this:
- [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access - [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access
https://nextjs.org/docs/messages/blocking-prerender-dynamic#wrap-in-or-move-into-suspense
- [cache] Cache the data access with \`"use cache"\` (does not apply to \`connection()\`) - [cache] Cache the data access with \`"use cache"\` (does not apply to \`connection()\`)
https://nextjs.org/docs/messages/blocking-prerender-dynamic#cache-the-component-or-data
- [block] Set \`export const instant = false\` to allow a blocking route - [block] Set \`export const instant = false\` to allow a blocking route
https://nextjs.org/docs/messages/blocking-prerender-dynamic#allow-blocking-route
Learn more: https://nextjs.org/docs/messages/blocking-prerender-dynamic
at a (<anonymous>) at a (<anonymous>)
at body (<anonymous>) at body (<anonymous>)
at html (<anonymous>) at html (<anonymous>)
......
...@@ -93,7 +93,7 @@ describe('instant validation - level manual-warning', () => { ...@@ -93,7 +93,7 @@ describe('instant validation - level manual-warning', () => {
], ],
}, },
], ],
"code": "E1398", "code": "E1437",
"description": "Next.js encountered uncached data during a navigation.", "description": "Next.js encountered uncached data during a navigation.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Instant", "label": "Instant",
...@@ -125,7 +125,7 @@ describe('instant validation - level manual-warning', () => { ...@@ -125,7 +125,7 @@ describe('instant validation - level manual-warning', () => {
], ],
}, },
], ],
"code": "E1398", "code": "E1437",
"description": "Next.js encountered uncached data during a navigation.", "description": "Next.js encountered uncached data during a navigation.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Instant", "label": "Instant",
...@@ -157,7 +157,7 @@ describe('instant validation - level manual-warning', () => { ...@@ -157,7 +157,7 @@ describe('instant validation - level manual-warning', () => {
], ],
}, },
], ],
"code": "E1398", "code": "E1437",
"description": "Next.js encountered uncached data during a navigation.", "description": "Next.js encountered uncached data during a navigation.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Instant", "label": "Instant",
...@@ -198,11 +198,10 @@ describe('instant validation - level manual-warning', () => { ...@@ -198,11 +198,10 @@ describe('instant validation - level manual-warning', () => {
Ways to fix this: Ways to fix this:
- [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access - [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access
https://nextjs.org/docs/messages/blocking-prerender-dynamic#wrap-in-or-move-into-suspense
- [cache] Cache the data access with \`"use cache"\` (does not apply to \`connection()\`) - [cache] Cache the data access with \`"use cache"\` (does not apply to \`connection()\`)
https://nextjs.org/docs/messages/blocking-prerender-dynamic#cache-the-component-or-data
- [block] Set \`export const instant = false\` to allow a blocking route - [block] Set \`export const instant = false\` to allow a blocking route
https://nextjs.org/docs/messages/blocking-prerender-dynamic#allow-blocking-route
Learn more: https://nextjs.org/docs/messages/blocking-prerender-dynamic
at a (<anonymous>) at a (<anonymous>)
at body (<anonymous>) at body (<anonymous>)
at html (<anonymous>) at html (<anonymous>)
...@@ -230,7 +229,7 @@ describe('instant validation - level manual-warning', () => { ...@@ -230,7 +229,7 @@ describe('instant validation - level manual-warning', () => {
// did not run under 'manual-warning'. // did not run under 'manual-warning'.
await expect(browser).toDisplayCollapsedRedbox(` await expect(browser).toDisplayCollapsedRedbox(`
{ {
"code": "E1401", "code": "E1440",
"description": "Next.js encountered uncached data during prerendering.", "description": "Next.js encountered uncached data during prerendering.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Blocking Route", "label": "Blocking Route",
...@@ -250,7 +249,7 @@ describe('instant validation - level manual-warning', () => { ...@@ -250,7 +249,7 @@ describe('instant validation - level manual-warning', () => {
) )
await expect(browser).toDisplayCollapsedRedbox(` await expect(browser).toDisplayCollapsedRedbox(`
{ {
"code": "E1401", "code": "E1440",
"description": "Next.js encountered uncached data during prerendering.", "description": "Next.js encountered uncached data during prerendering.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Blocking Route", "label": "Blocking Route",
...@@ -270,7 +269,7 @@ describe('instant validation - level manual-warning', () => { ...@@ -270,7 +269,7 @@ describe('instant validation - level manual-warning', () => {
) )
await expect(browser).toDisplayCollapsedRedbox(` await expect(browser).toDisplayCollapsedRedbox(`
{ {
"code": "E1401", "code": "E1440",
"description": "Next.js encountered uncached data during prerendering.", "description": "Next.js encountered uncached data during prerendering.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Blocking Route", "label": "Blocking Route",
...@@ -290,7 +289,7 @@ describe('instant validation - level manual-warning', () => { ...@@ -290,7 +289,7 @@ describe('instant validation - level manual-warning', () => {
) )
await expect(browser).toDisplayCollapsedRedbox(` await expect(browser).toDisplayCollapsedRedbox(`
{ {
"code": "E1401", "code": "E1440",
"description": "Next.js encountered uncached data during prerendering.", "description": "Next.js encountered uncached data during prerendering.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Blocking Route", "label": "Blocking Route",
...@@ -337,11 +336,10 @@ describe('instant validation - level manual-warning', () => { ...@@ -337,11 +336,10 @@ describe('instant validation - level manual-warning', () => {
Ways to fix this: Ways to fix this:
- [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access - [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access
https://nextjs.org/docs/messages/blocking-prerender-dynamic#wrap-in-or-move-into-suspense
- [cache] For uncached data (\`fetch\`, database calls): cache the access with \`"use cache"\` (does not apply to \`connection()\`) - [cache] For uncached data (\`fetch\`, database calls): cache the access with \`"use cache"\` (does not apply to \`connection()\`)
https://nextjs.org/docs/messages/blocking-prerender-dynamic#cache-the-component-or-data
- [block] Set \`export const instant = false\` to allow a blocking route - [block] Set \`export const instant = false\` to allow a blocking route
https://nextjs.org/docs/messages/blocking-prerender-dynamic#allow-blocking-route
Learn more: https://nextjs.org/docs/messages/blocking-prerender-dynamic
at body (<anonymous>) at body (<anonymous>)
at html (<anonymous>) at html (<anonymous>)
To get a more detailed stack trace and pinpoint the issue, try one of the following: To get a more detailed stack trace and pinpoint the issue, try one of the following:
...@@ -363,11 +361,10 @@ describe('instant validation - level manual-warning', () => { ...@@ -363,11 +361,10 @@ describe('instant validation - level manual-warning', () => {
Ways to fix this: Ways to fix this:
- [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access - [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access
https://nextjs.org/docs/messages/blocking-prerender-dynamic#wrap-in-or-move-into-suspense
- [cache] For uncached data (\`fetch\`, database calls): cache the access with \`"use cache"\` (does not apply to \`connection()\`) - [cache] For uncached data (\`fetch\`, database calls): cache the access with \`"use cache"\` (does not apply to \`connection()\`)
https://nextjs.org/docs/messages/blocking-prerender-dynamic#cache-the-component-or-data
- [block] Set \`export const instant = false\` to allow a blocking route - [block] Set \`export const instant = false\` to allow a blocking route
https://nextjs.org/docs/messages/blocking-prerender-dynamic#allow-blocking-route
Learn more: https://nextjs.org/docs/messages/blocking-prerender-dynamic
at body (<anonymous>) at body (<anonymous>)
at html (<anonymous>) at html (<anonymous>)
To get a more detailed stack trace and pinpoint the issue, try one of the following: To get a more detailed stack trace and pinpoint the issue, try one of the following:
...@@ -391,11 +388,10 @@ describe('instant validation - level manual-warning', () => { ...@@ -391,11 +388,10 @@ describe('instant validation - level manual-warning', () => {
Ways to fix this: Ways to fix this:
- [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access - [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access
https://nextjs.org/docs/messages/blocking-prerender-dynamic#wrap-in-or-move-into-suspense
- [cache] For uncached data (\`fetch\`, database calls): cache the access with \`"use cache"\` (does not apply to \`connection()\`) - [cache] For uncached data (\`fetch\`, database calls): cache the access with \`"use cache"\` (does not apply to \`connection()\`)
https://nextjs.org/docs/messages/blocking-prerender-dynamic#cache-the-component-or-data
- [block] Set \`export const instant = false\` to allow a blocking route - [block] Set \`export const instant = false\` to allow a blocking route
https://nextjs.org/docs/messages/blocking-prerender-dynamic#allow-blocking-route
Learn more: https://nextjs.org/docs/messages/blocking-prerender-dynamic
at body (<anonymous>) at body (<anonymous>)
at html (<anonymous>) at html (<anonymous>)
To get a more detailed stack trace and pinpoint the issue, try one of the following: To get a more detailed stack trace and pinpoint the issue, try one of the following:
...@@ -423,11 +419,10 @@ describe('instant validation - level manual-warning', () => { ...@@ -423,11 +419,10 @@ describe('instant validation - level manual-warning', () => {
Ways to fix this: Ways to fix this:
- [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access - [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access
https://nextjs.org/docs/messages/blocking-prerender-dynamic#wrap-in-or-move-into-suspense
- [cache] For uncached data (\`fetch\`, database calls): cache the access with \`"use cache"\` (does not apply to \`connection()\`) - [cache] For uncached data (\`fetch\`, database calls): cache the access with \`"use cache"\` (does not apply to \`connection()\`)
https://nextjs.org/docs/messages/blocking-prerender-dynamic#cache-the-component-or-data
- [block] Set \`export const instant = false\` to allow a blocking route - [block] Set \`export const instant = false\` to allow a blocking route
https://nextjs.org/docs/messages/blocking-prerender-dynamic#allow-blocking-route
Learn more: https://nextjs.org/docs/messages/blocking-prerender-dynamic
at body (<anonymous>) at body (<anonymous>)
at html (<anonymous>) at html (<anonymous>)
To get a more detailed stack trace and pinpoint the issue, try one of the following: To get a more detailed stack trace and pinpoint the issue, try one of the following:
......
...@@ -60,7 +60,7 @@ describe('instant validation - level warning', () => { ...@@ -60,7 +60,7 @@ describe('instant validation - level warning', () => {
const browser = await next.browser('/bare') const browser = await next.browser('/bare')
await expect(browser).toDisplayCollapsedRedbox(` await expect(browser).toDisplayCollapsedRedbox(`
{ {
"code": "E1398", "code": "E1437",
"description": "Next.js encountered uncached data during a navigation.", "description": "Next.js encountered uncached data during a navigation.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Instant", "label": "Instant",
...@@ -90,7 +90,7 @@ describe('instant validation - level warning', () => { ...@@ -90,7 +90,7 @@ describe('instant validation - level warning', () => {
], ],
}, },
], ],
"code": "E1398", "code": "E1437",
"description": "Next.js encountered uncached data during a navigation.", "description": "Next.js encountered uncached data during a navigation.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Instant", "label": "Instant",
...@@ -120,7 +120,7 @@ describe('instant validation - level warning', () => { ...@@ -120,7 +120,7 @@ describe('instant validation - level warning', () => {
], ],
}, },
], ],
"code": "E1398", "code": "E1437",
"description": "Next.js encountered uncached data during a navigation.", "description": "Next.js encountered uncached data during a navigation.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Instant", "label": "Instant",
...@@ -150,7 +150,7 @@ describe('instant validation - level warning', () => { ...@@ -150,7 +150,7 @@ describe('instant validation - level warning', () => {
], ],
}, },
], ],
"code": "E1398", "code": "E1437",
"description": "Next.js encountered uncached data during a navigation.", "description": "Next.js encountered uncached data during a navigation.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Instant", "label": "Instant",
...@@ -177,7 +177,7 @@ describe('instant validation - level warning', () => { ...@@ -177,7 +177,7 @@ describe('instant validation - level warning', () => {
const browser = await next.browser('/layered') const browser = await next.browser('/layered')
await expect(browser).toDisplayCollapsedRedbox(` await expect(browser).toDisplayCollapsedRedbox(`
{ {
"code": "E1398", "code": "E1437",
"description": "Next.js encountered uncached data during a navigation.", "description": "Next.js encountered uncached data during a navigation.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Instant", "label": "Instant",
...@@ -208,11 +208,10 @@ describe('instant validation - level warning', () => { ...@@ -208,11 +208,10 @@ describe('instant validation - level warning', () => {
Ways to fix this: Ways to fix this:
- [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access - [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access
https://nextjs.org/docs/messages/blocking-prerender-dynamic#wrap-in-or-move-into-suspense
- [cache] Cache the data access with \`"use cache"\` (does not apply to \`connection()\`) - [cache] Cache the data access with \`"use cache"\` (does not apply to \`connection()\`)
https://nextjs.org/docs/messages/blocking-prerender-dynamic#cache-the-component-or-data
- [block] Set \`export const instant = false\` to allow a blocking route - [block] Set \`export const instant = false\` to allow a blocking route
https://nextjs.org/docs/messages/blocking-prerender-dynamic#allow-blocking-route
Learn more: https://nextjs.org/docs/messages/blocking-prerender-dynamic
at a (<anonymous>) at a (<anonymous>)
at body (<anonymous>) at body (<anonymous>)
at html (<anonymous>) at html (<anonymous>)
......
...@@ -45,7 +45,7 @@ describe('instant validation', () => { ...@@ -45,7 +45,7 @@ describe('instant validation', () => {
await browser.elementByCss('main') await browser.elementByCss('main')
await expect(browser).toDisplayCollapsedRedbox(` await expect(browser).toDisplayCollapsedRedbox(`
{ {
"code": "E1401", "code": "E1440",
"description": "Next.js encountered uncached data during prerendering.", "description": "Next.js encountered uncached data during prerendering.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Blocking Route", "label": "Blocking Route",
......
...@@ -124,7 +124,7 @@ describe('instant validation - parallel slot configs', () => { ...@@ -124,7 +124,7 @@ describe('instant validation - parallel slot configs', () => {
], ],
}, },
], ],
"code": "E1402", "code": "E1430",
"description": "Next.js encountered runtime data during a navigation.", "description": "Next.js encountered runtime data during a navigation.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Instant", "label": "Instant",
...@@ -148,9 +148,9 @@ describe('instant validation - parallel slot configs', () => { ...@@ -148,9 +148,9 @@ describe('instant validation - parallel slot configs', () => {
Ways to fix this: Ways to fix this:
- [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access - [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access
https://nextjs.org/docs/messages/blocking-prerender-runtime#wrap-in-or-move-into-suspense
- [block] Set \`export const instant = false\` to allow a blocking route - [block] Set \`export const instant = false\` to allow a blocking route
https://nextjs.org/docs/messages/blocking-prerender-runtime#allow-blocking-route
Learn more: https://nextjs.org/docs/messages/blocking-prerender-runtime
at body (<anonymous>) at body (<anonymous>)
at html (<anonymous>) at html (<anonymous>)
at a (<anonymous>) at a (<anonymous>)
...@@ -183,7 +183,7 @@ describe('instant validation - parallel slot configs', () => { ...@@ -183,7 +183,7 @@ describe('instant validation - parallel slot configs', () => {
], ],
}, },
], ],
"code": "E1402", "code": "E1430",
"description": "Next.js encountered runtime data during a navigation.", "description": "Next.js encountered runtime data during a navigation.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Instant", "label": "Instant",
...@@ -207,9 +207,9 @@ describe('instant validation - parallel slot configs', () => { ...@@ -207,9 +207,9 @@ describe('instant validation - parallel slot configs', () => {
Ways to fix this: Ways to fix this:
- [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access - [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access
https://nextjs.org/docs/messages/blocking-prerender-runtime#wrap-in-or-move-into-suspense
- [block] Set \`export const instant = false\` to allow a blocking route - [block] Set \`export const instant = false\` to allow a blocking route
https://nextjs.org/docs/messages/blocking-prerender-runtime#allow-blocking-route
Learn more: https://nextjs.org/docs/messages/blocking-prerender-runtime
at body (<anonymous>) at body (<anonymous>)
at html (<anonymous>) at html (<anonymous>)
at a (<anonymous>) at a (<anonymous>)
...@@ -263,7 +263,7 @@ describe('instant validation - parallel slot configs', () => { ...@@ -263,7 +263,7 @@ describe('instant validation - parallel slot configs', () => {
], ],
}, },
], ],
"code": "E1402", "code": "E1430",
"description": "Next.js encountered runtime data during a navigation.", "description": "Next.js encountered runtime data during a navigation.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Instant", "label": "Instant",
...@@ -287,9 +287,9 @@ describe('instant validation - parallel slot configs', () => { ...@@ -287,9 +287,9 @@ describe('instant validation - parallel slot configs', () => {
Ways to fix this: Ways to fix this:
- [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access - [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access
https://nextjs.org/docs/messages/blocking-prerender-runtime#wrap-in-or-move-into-suspense
- [block] Set \`export const instant = false\` to allow a blocking route - [block] Set \`export const instant = false\` to allow a blocking route
https://nextjs.org/docs/messages/blocking-prerender-runtime#allow-blocking-route
Learn more: https://nextjs.org/docs/messages/blocking-prerender-runtime
at div (<anonymous>) at div (<anonymous>)
at body (<anonymous>) at body (<anonymous>)
at html (<anonymous>) at html (<anonymous>)
...@@ -324,7 +324,7 @@ describe('instant validation - parallel slot configs', () => { ...@@ -324,7 +324,7 @@ describe('instant validation - parallel slot configs', () => {
], ],
}, },
], ],
"code": "E1402", "code": "E1430",
"description": "Next.js encountered runtime data during a navigation.", "description": "Next.js encountered runtime data during a navigation.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Instant", "label": "Instant",
...@@ -348,7 +348,7 @@ describe('instant validation - parallel slot configs', () => { ...@@ -348,7 +348,7 @@ describe('instant validation - parallel slot configs', () => {
], ],
}, },
], ],
"code": "E1402", "code": "E1430",
"description": "Next.js encountered runtime data during a navigation.", "description": "Next.js encountered runtime data during a navigation.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Instant", "label": "Instant",
...@@ -373,9 +373,9 @@ describe('instant validation - parallel slot configs', () => { ...@@ -373,9 +373,9 @@ describe('instant validation - parallel slot configs', () => {
Ways to fix this: Ways to fix this:
- [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access - [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access
https://nextjs.org/docs/messages/blocking-prerender-runtime#wrap-in-or-move-into-suspense
- [block] Set \`export const instant = false\` to allow a blocking route - [block] Set \`export const instant = false\` to allow a blocking route
https://nextjs.org/docs/messages/blocking-prerender-runtime#allow-blocking-route
Learn more: https://nextjs.org/docs/messages/blocking-prerender-runtime
at div (<anonymous>) at div (<anonymous>)
at body (<anonymous>) at body (<anonymous>)
at html (<anonymous>) at html (<anonymous>)
...@@ -386,9 +386,9 @@ describe('instant validation - parallel slot configs', () => { ...@@ -386,9 +386,9 @@ describe('instant validation - parallel slot configs', () => {
Ways to fix this: Ways to fix this:
- [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access - [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access
https://nextjs.org/docs/messages/blocking-prerender-runtime#wrap-in-or-move-into-suspense
- [block] Set \`export const instant = false\` to allow a blocking route - [block] Set \`export const instant = false\` to allow a blocking route
https://nextjs.org/docs/messages/blocking-prerender-runtime#allow-blocking-route
Learn more: https://nextjs.org/docs/messages/blocking-prerender-runtime
at body (<anonymous>) at body (<anonymous>)
at html (<anonymous>) at html (<anonymous>)
at b (<anonymous>) at b (<anonymous>)
...@@ -489,7 +489,7 @@ describe('instant validation - parallel slot configs', () => { ...@@ -489,7 +489,7 @@ describe('instant validation - parallel slot configs', () => {
], ],
}, },
], ],
"code": "E1402", "code": "E1430",
"description": "Next.js encountered runtime data during a navigation.", "description": "Next.js encountered runtime data during a navigation.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Instant", "label": "Instant",
...@@ -511,9 +511,9 @@ describe('instant validation - parallel slot configs', () => { ...@@ -511,9 +511,9 @@ describe('instant validation - parallel slot configs', () => {
Ways to fix this: Ways to fix this:
- [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access - [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access
https://nextjs.org/docs/messages/blocking-prerender-runtime#wrap-in-or-move-into-suspense
- [block] Set \`export const instant = false\` to allow a blocking route - [block] Set \`export const instant = false\` to allow a blocking route
https://nextjs.org/docs/messages/blocking-prerender-runtime#allow-blocking-route
Learn more: https://nextjs.org/docs/messages/blocking-prerender-runtime
at div (<anonymous>) at div (<anonymous>)
at main (<anonymous>) at main (<anonymous>)
at body (<anonymous>) at body (<anonymous>)
...@@ -581,7 +581,7 @@ describe('instant validation - parallel slot configs', () => { ...@@ -581,7 +581,7 @@ describe('instant validation - parallel slot configs', () => {
], ],
}, },
], ],
"code": "E1402", "code": "E1430",
"description": "Next.js encountered runtime data during a navigation.", "description": "Next.js encountered runtime data during a navigation.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Instant", "label": "Instant",
......
...@@ -21,7 +21,7 @@ export function registerSyncIoAndBlockingTests( ...@@ -21,7 +21,7 @@ export function registerSyncIoAndBlockingTests(
if (partialPrefetching) { if (partialPrefetching) {
await expect(browser).toDisplayCollapsedRedbox(` await expect(browser).toDisplayCollapsedRedbox(`
{ {
"code": "E1295", "code": "E1432",
"description": "Next.js encountered the unstable value Date.now() while prerendering.", "description": "Next.js encountered the unstable value Date.now() while prerendering.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Blocking Route", "label": "Blocking Route",
...@@ -50,13 +50,11 @@ export function registerSyncIoAndBlockingTests( ...@@ -50,13 +50,11 @@ export function registerSyncIoAndBlockingTests(
Ways to fix this: Ways to fix this:
- [dynamic] Render at request time by adding a dynamic data access (e.g. \`await connection()\`) before this call - [dynamic] Render at request time by adding a dynamic data access (e.g. \`await connection()\`) before this call
https://nextjs.org/docs/messages/blocking-prerender-current-time#generate-on-every-request
- [cache] Prerender and cache the value with \`"use cache"\` - [cache] Prerender and cache the value with \`"use cache"\`
https://nextjs.org/docs/messages/blocking-prerender-current-time#cache-the-timestamp
- [client] Render the value on the client with \`"use client"\` - [client] Render the value on the client with \`"use client"\`
https://nextjs.org/docs/messages/blocking-prerender-current-time#render-on-the-client
- [measure] If the value is for telemetry, use a timing API such as \`performance.now()\` - [measure] If the value is for telemetry, use a timing API such as \`performance.now()\`
https://nextjs.org/docs/messages/blocking-prerender-current-time#for-telemetry-use-a-timing-api
Learn more: https://nextjs.org/docs/messages/blocking-prerender-current-time
at a (app/suspense-in-root/sync-io/sync-io-after-cookies/page.tsx:29:15) at a (app/suspense-in-root/sync-io/sync-io-after-cookies/page.tsx:29:15)
27 | async function SyncIOAfterCookies() { 27 | async function SyncIOAfterCookies() {
28 | await cookies() 28 | await cookies()
...@@ -85,7 +83,7 @@ export function registerSyncIoAndBlockingTests( ...@@ -85,7 +83,7 @@ export function registerSyncIoAndBlockingTests(
if (partialPrefetching) { if (partialPrefetching) {
await expect(browser).toDisplayCollapsedRedbox(` await expect(browser).toDisplayCollapsedRedbox(`
{ {
"code": "E1295", "code": "E1432",
"description": "Next.js encountered the unstable value Date.now() while prerendering.", "description": "Next.js encountered the unstable value Date.now() while prerendering.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Blocking Route", "label": "Blocking Route",
...@@ -126,13 +124,11 @@ export function registerSyncIoAndBlockingTests( ...@@ -126,13 +124,11 @@ export function registerSyncIoAndBlockingTests(
Ways to fix this: Ways to fix this:
- [dynamic] Render at request time by adding a dynamic data access (e.g. \`await connection()\`) before this call - [dynamic] Render at request time by adding a dynamic data access (e.g. \`await connection()\`) before this call
https://nextjs.org/docs/messages/blocking-prerender-current-time#generate-on-every-request
- [cache] Prerender and cache the value with \`"use cache"\` - [cache] Prerender and cache the value with \`"use cache"\`
https://nextjs.org/docs/messages/blocking-prerender-current-time#cache-the-timestamp
- [client] Render the value on the client with \`"use client"\` - [client] Render the value on the client with \`"use client"\`
https://nextjs.org/docs/messages/blocking-prerender-current-time#render-on-the-client
- [measure] If the value is for telemetry, use a timing API such as \`performance.now()\` - [measure] If the value is for telemetry, use a timing API such as \`performance.now()\`
https://nextjs.org/docs/messages/blocking-prerender-current-time#for-telemetry-use-a-timing-api
Learn more: https://nextjs.org/docs/messages/blocking-prerender-current-time
at a (app/suspense-in-root/sync-io/sync-io-after-cache-with-cookie-input/page.tsx:49:15) at a (app/suspense-in-root/sync-io/sync-io-after-cache-with-cookie-input/page.tsx:49:15)
47 | const cookiePromise = cookies().then((c) => c.get('testCookie')?.value ?? '') 47 | const cookiePromise = cookies().then((c) => c.get('testCookie')?.value ?? '')
48 | await cachedFn(cookiePromise) 48 | await cachedFn(cookiePromise)
...@@ -158,7 +154,7 @@ export function registerSyncIoAndBlockingTests( ...@@ -158,7 +154,7 @@ export function registerSyncIoAndBlockingTests(
if (partialPrefetching) { if (partialPrefetching) {
await expect(browser).toDisplayCollapsedRedbox(` await expect(browser).toDisplayCollapsedRedbox(`
{ {
"code": "E1295", "code": "E1432",
"description": "Next.js encountered the unstable value Date.now() while prerendering.", "description": "Next.js encountered the unstable value Date.now() while prerendering.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Blocking Route", "label": "Blocking Route",
...@@ -187,13 +183,11 @@ export function registerSyncIoAndBlockingTests( ...@@ -187,13 +183,11 @@ export function registerSyncIoAndBlockingTests(
Ways to fix this: Ways to fix this:
- [dynamic] Render at request time by adding a dynamic data access (e.g. \`await connection()\`) before this call - [dynamic] Render at request time by adding a dynamic data access (e.g. \`await connection()\`) before this call
https://nextjs.org/docs/messages/blocking-prerender-current-time#generate-on-every-request
- [cache] Prerender and cache the value with \`"use cache"\` - [cache] Prerender and cache the value with \`"use cache"\`
https://nextjs.org/docs/messages/blocking-prerender-current-time#cache-the-timestamp
- [client] Render the value on the client with \`"use client"\` - [client] Render the value on the client with \`"use client"\`
https://nextjs.org/docs/messages/blocking-prerender-current-time#render-on-the-client
- [measure] If the value is for telemetry, use a timing API such as \`performance.now()\` - [measure] If the value is for telemetry, use a timing API such as \`performance.now()\`
https://nextjs.org/docs/messages/blocking-prerender-current-time#for-telemetry-use-a-timing-api
Learn more: https://nextjs.org/docs/messages/blocking-prerender-current-time
at Module.e [as generateMetadata] (app/suspense-in-root/sync-io/sync-io-after-cookies-in-generate-metadata/page.tsx:8:20) at Module.e [as generateMetadata] (app/suspense-in-root/sync-io/sync-io-after-cookies-in-generate-metadata/page.tsx:8:20)
6 | export async function generateMetadata() { 6 | export async function generateMetadata() {
7 | await cookies() 7 | await cookies()
...@@ -269,7 +263,7 @@ export function registerSyncIoAndBlockingTests( ...@@ -269,7 +263,7 @@ export function registerSyncIoAndBlockingTests(
], ],
}, },
], ],
"code": "E1402", "code": "E1430",
"description": "Next.js encountered runtime data during a navigation.", "description": "Next.js encountered runtime data during a navigation.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Instant", "label": "Instant",
...@@ -299,9 +293,9 @@ export function registerSyncIoAndBlockingTests( ...@@ -299,9 +293,9 @@ export function registerSyncIoAndBlockingTests(
Ways to fix this: Ways to fix this:
- [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access - [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access
https://nextjs.org/docs/messages/blocking-prerender-runtime#wrap-in-or-move-into-suspense
- [block] Set \`export const instant = false\` to allow a blocking route - [block] Set \`export const instant = false\` to allow a blocking route
https://nextjs.org/docs/messages/blocking-prerender-runtime#allow-blocking-route
Learn more: https://nextjs.org/docs/messages/blocking-prerender-runtime
at body (<anonymous>) at body (<anonymous>)
at html (<anonymous>) at html (<anonymous>)
at a (<anonymous>) at a (<anonymous>)
...@@ -368,7 +362,7 @@ export function registerSyncIoAndBlockingTests( ...@@ -368,7 +362,7 @@ export function registerSyncIoAndBlockingTests(
], ],
}, },
], ],
"code": "E1402", "code": "E1430",
"description": "Next.js encountered runtime data during a navigation.", "description": "Next.js encountered runtime data during a navigation.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Instant", "label": "Instant",
...@@ -398,9 +392,9 @@ export function registerSyncIoAndBlockingTests( ...@@ -398,9 +392,9 @@ export function registerSyncIoAndBlockingTests(
Ways to fix this: Ways to fix this:
- [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access - [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access
https://nextjs.org/docs/messages/blocking-prerender-runtime#wrap-in-or-move-into-suspense
- [block] Set \`export const instant = false\` to allow a blocking route - [block] Set \`export const instant = false\` to allow a blocking route
https://nextjs.org/docs/messages/blocking-prerender-runtime#allow-blocking-route
Learn more: https://nextjs.org/docs/messages/blocking-prerender-runtime
at div (<anonymous>) at div (<anonymous>)
at body (<anonymous>) at body (<anonymous>)
at html (<anonymous>) at html (<anonymous>)
...@@ -435,7 +429,7 @@ export function registerSyncIoAndBlockingTests( ...@@ -435,7 +429,7 @@ export function registerSyncIoAndBlockingTests(
], ],
}, },
], ],
"code": "E1398", "code": "E1437",
"description": "Next.js encountered uncached data during a navigation.", "description": "Next.js encountered uncached data during a navigation.",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Instant", "label": "Instant",
...@@ -459,11 +453,10 @@ export function registerSyncIoAndBlockingTests( ...@@ -459,11 +453,10 @@ export function registerSyncIoAndBlockingTests(
Ways to fix this: Ways to fix this:
- [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access - [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access
https://nextjs.org/docs/messages/blocking-prerender-dynamic#wrap-in-or-move-into-suspense
- [cache] Cache the data access with \`"use cache"\` (does not apply to \`connection()\`) - [cache] Cache the data access with \`"use cache"\` (does not apply to \`connection()\`)
https://nextjs.org/docs/messages/blocking-prerender-dynamic#cache-the-component-or-data
- [block] Set \`export const instant = false\` to allow a blocking route - [block] Set \`export const instant = false\` to allow a blocking route
https://nextjs.org/docs/messages/blocking-prerender-dynamic#allow-blocking-route
Learn more: https://nextjs.org/docs/messages/blocking-prerender-dynamic
at div (<anonymous>) at div (<anonymous>)
at body (<anonymous>) at body (<anonymous>)
at html (<anonymous>) at html (<anonymous>)
......
...@@ -26,7 +26,7 @@ describe('missing-suspense-with-csr-bailout', () => { ...@@ -26,7 +26,7 @@ describe('missing-suspense-with-csr-bailout', () => {
describe('useSearchParams', () => { describe('useSearchParams', () => {
const message = isCacheComponentsEnabled const message = isCacheComponentsEnabled
? 'https://nextjs.org/docs/messages/blocking-prerender-client-hook#wrap-in-or-move-into-suspense' ? 'https://nextjs.org/docs/messages/blocking-prerender-client-hook'
: `useSearchParams() should be wrapped in a suspense boundary at page "/".` : `useSearchParams() should be wrapped in a suspense boundary at page "/".`
it('should fail build if useSearchParams is not wrapped in a suspense boundary', async () => { it('should fail build if useSearchParams is not wrapped in a suspense boundary', async () => {
......
...@@ -89,11 +89,10 @@ describe('build-output-prerender', () => { ...@@ -89,11 +89,10 @@ describe('build-output-prerender', () => {
Ways to fix this: Ways to fix this:
- [stream] Wrap the Client Component in \`<Suspense fallback={...}>\` - [stream] Wrap the Client Component in \`<Suspense fallback={...}>\`
https://nextjs.org/docs/messages/blocking-prerender-current-time-client#wrap-in-or-move-into-suspense
- [defer] Move the read into a \`useEffect\` or event handler - [defer] Move the read into a \`useEffect\` or event handler
https://nextjs.org/docs/messages/blocking-prerender-current-time-client#move-into-effect-or-event-handler
- [measure] If the value is for telemetry, use a timing API such as \`performance.now()\` - [measure] If the value is for telemetry, use a timing API such as \`performance.now()\`
https://nextjs.org/docs/messages/blocking-prerender-current-time-client#for-telemetry-use-a-timing-api
Learn more: https://nextjs.org/docs/messages/blocking-prerender-current-time-client
at <unknown> (app/client/page.tsx:4:28) at <unknown> (app/client/page.tsx:4:28)
2 | 2 |
3 | export default function Page() { 3 | export default function Page() {
...@@ -115,11 +114,10 @@ describe('build-output-prerender', () => { ...@@ -115,11 +114,10 @@ describe('build-output-prerender', () => {
Ways to fix this: Ways to fix this:
- [stream] Wrap the Client Component in \`<Suspense fallback={...}>\` - [stream] Wrap the Client Component in \`<Suspense fallback={...}>\`
https://nextjs.org/docs/messages/blocking-prerender-current-time-client#wrap-in-or-move-into-suspense
- [defer] Move the read into a \`useEffect\` or event handler - [defer] Move the read into a \`useEffect\` or event handler
https://nextjs.org/docs/messages/blocking-prerender-current-time-client#move-into-effect-or-event-handler
- [measure] If the value is for telemetry, use a timing API such as \`performance.now()\` - [measure] If the value is for telemetry, use a timing API such as \`performance.now()\`
https://nextjs.org/docs/messages/blocking-prerender-current-time-client#for-telemetry-use-a-timing-api
Learn more: https://nextjs.org/docs/messages/blocking-prerender-current-time-client
at x (<next-dist-dir>) at x (<next-dist-dir>)
To get a more detailed stack trace and pinpoint the issue, try one of the following: 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 "/client" in your browser to investigate the error. - Start the app in development mode by running \`next dev\`, then open "/client" in your browser to investigate the error.
...@@ -244,11 +242,10 @@ describe('build-output-prerender', () => { ...@@ -244,11 +242,10 @@ describe('build-output-prerender', () => {
Ways to fix this: Ways to fix this:
- [stream] Wrap the Client Component in \`<Suspense fallback={...}>\` - [stream] Wrap the Client Component in \`<Suspense fallback={...}>\`
https://nextjs.org/docs/messages/blocking-prerender-current-time-client#wrap-in-or-move-into-suspense
- [defer] Move the read into a \`useEffect\` or event handler - [defer] Move the read into a \`useEffect\` or event handler
https://nextjs.org/docs/messages/blocking-prerender-current-time-client#move-into-effect-or-event-handler
- [measure] If the value is for telemetry, use a timing API such as \`performance.now()\` - [measure] If the value is for telemetry, use a timing API such as \`performance.now()\`
https://nextjs.org/docs/messages/blocking-prerender-current-time-client#for-telemetry-use-a-timing-api
Learn more: https://nextjs.org/docs/messages/blocking-prerender-current-time-client
at Page (app/client/page.tsx:4:28) at Page (app/client/page.tsx:4:28)
2 | 2 |
3 | export default function Page() { 3 | export default function Page() {
...@@ -264,11 +261,10 @@ describe('build-output-prerender', () => { ...@@ -264,11 +261,10 @@ describe('build-output-prerender', () => {
Ways to fix this: Ways to fix this:
- [dynamic] Render at request time by adding a dynamic data access (e.g. \`await connection()\`) before this call - [dynamic] Render at request time by adding a dynamic data access (e.g. \`await connection()\`) before this call
https://nextjs.org/docs/messages/blocking-prerender-random#generate-on-every-request
- [cache] Prerender and cache the value with \`"use cache"\` - [cache] Prerender and cache the value with \`"use cache"\`
https://nextjs.org/docs/messages/blocking-prerender-random#cache-the-random-value
- [client] Render the value on the client with \`"use client"\` - [client] Render the value on the client with \`"use client"\`
https://nextjs.org/docs/messages/blocking-prerender-random#render-on-the-client
Learn more: https://nextjs.org/docs/messages/blocking-prerender-random
at Page (app/server/page.tsx:13:27) at Page (app/server/page.tsx:13:27)
at Page (<anonymous>) at Page (<anonymous>)
11 | await cachedDelay() 11 | await cachedDelay()
...@@ -293,11 +289,10 @@ describe('build-output-prerender', () => { ...@@ -293,11 +289,10 @@ describe('build-output-prerender', () => {
Ways to fix this: Ways to fix this:
- [stream] Wrap the Client Component in \`<Suspense fallback={...}>\` - [stream] Wrap the Client Component in \`<Suspense fallback={...}>\`
https://nextjs.org/docs/messages/blocking-prerender-current-time-client#wrap-in-or-move-into-suspense
- [defer] Move the read into a \`useEffect\` or event handler - [defer] Move the read into a \`useEffect\` or event handler
https://nextjs.org/docs/messages/blocking-prerender-current-time-client#move-into-effect-or-event-handler
- [measure] If the value is for telemetry, use a timing API such as \`performance.now()\` - [measure] If the value is for telemetry, use a timing API such as \`performance.now()\`
https://nextjs.org/docs/messages/blocking-prerender-current-time-client#for-telemetry-use-a-timing-api
Learn more: https://nextjs.org/docs/messages/blocking-prerender-current-time-client
at Page (webpack:///app/client/page.tsx:4:28) at Page (webpack:///app/client/page.tsx:4:28)
at ClientPageRoot (webpack:///src/client/components/client-page.tsx:56:10) at ClientPageRoot (webpack:///src/client/components/client-page.tsx:56:10)
2 | 2 |
...@@ -314,11 +309,10 @@ describe('build-output-prerender', () => { ...@@ -314,11 +309,10 @@ describe('build-output-prerender', () => {
Ways to fix this: Ways to fix this:
- [dynamic] Render at request time by adding a dynamic data access (e.g. \`await connection()\`) before this call - [dynamic] Render at request time by adding a dynamic data access (e.g. \`await connection()\`) before this call
https://nextjs.org/docs/messages/blocking-prerender-random#generate-on-every-request
- [cache] Prerender and cache the value with \`"use cache"\` - [cache] Prerender and cache the value with \`"use cache"\`
https://nextjs.org/docs/messages/blocking-prerender-random#cache-the-random-value
- [client] Render the value on the client with \`"use client"\` - [client] Render the value on the client with \`"use client"\`
https://nextjs.org/docs/messages/blocking-prerender-random#render-on-the-client
Learn more: https://nextjs.org/docs/messages/blocking-prerender-random
at Page (webpack:///app/server/page.tsx:13:27) at Page (webpack:///app/server/page.tsx:13:27)
at Page (<anonymous>) at Page (<anonymous>)
11 | await cachedDelay() 11 | await cachedDelay()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment