Skip to content

Replace jest-worker with custom worker pool#90532

Draft
sokra wants to merge 16 commits intocanaryfrom
sokra/static-worker-count
Draft

Replace jest-worker with custom worker pool#90532
sokra wants to merge 16 commits intocanaryfrom
sokra/static-worker-count

Conversation

@sokra
Copy link
Member

@sokra sokra commented Feb 25, 2026

What?

Replaces the vendored jest-worker dependency with a purpose-built worker pool implementation (packages/next/src/lib/worker/). Deletes the compiled jest-worker bundle and all associated type declarations.

Why?

  • jest-worker is maintained for Jest's needs, not Next.js's. It eagerly spawns all workers at construction and doesn't support per-worker concurrency, boot throttling, or fine-grained crash recovery.
  • Removing it eliminates a compiled dependency that was difficult to debug and upgrade.
  • A custom pool lets us add features like lazy spawning and boot throttling that directly benefit next build performance with many static pages.

How?

New files in packages/next/src/lib/worker/:

File Purpose
worker-pool.ts Core pool: lazy spawning, dynamic scaling, per-worker concurrency, task queue, crash recovery, graceful shutdown
index.ts High-level Worker class (drop-in replacement): timeout/restart, NODE_OPTIONS, color propagation, exposed methods
types.ts Shared message constants and TypeScript types for the IPC protocol
worker-child-common.ts Shared child protocol logic (ChildTransport + createMessageHandler)
worker-process-child.ts child_process entry point (thin wrapper)
worker-thread-child.ts worker_threads entry point (thin wrapper)
README.md Architecture docs, message protocol, complete options/methods reference

Key features of the new pool:

  • Lazy spawning: Workers are created on-demand when tasks are dispatched, not at construction time
  • Dynamic scaling: Worker count grows from 0 to maxWorkers as concurrent tasks increase
  • Per-worker concurrency: concurrencyPerWorker allows multiple in-flight calls per worker
  • Boot throttling: maxBootingWorkers (default: ceil(maxWorkers/4)) limits concurrent worker startups. Workers send a PARENT_MESSAGE_READY message after loading their module and running setup(). When the booting limit is reached, tasks queue instead of spawning new workers.
  • Fault recovery: maxRespawns controls how many times a worker slot is respawned after unexpected exits. In-flight requests are always rejected; queued tasks are dispatched to healthy workers.

Other changes:

  • collect-build-traces.ts: Updated standalone trace paths from jest-worker/*Child to worker-*-child
  • type-check.ts: Removed stale 'Call retries were exceeded' catch guard (jest-worker message that the new pool never produces), removed unnecessary try/catch wrapper
  • next-dev-server.ts: Switched import to new Worker class, added required options (debuggerPortOffset, isolatedMemory, exposedMethods), removed manual stdout/stderr piping (handled internally now)
  • tsec-exemptions.json: Added ban-eval-calls exemption for worker-child-common.ts (eval('require') prevents static analysis of dynamic module paths in child process entry points)
  • errors.json: Added error codes 1076–1085 for worker pool error messages
  • Deleted src/compiled/jest-worker/ and removed type declarations from compiled.d.ts / $$compiled.internal.d.ts

Updated existing tests:

  • test/production/next-server-nft: Updated NFT snapshot to include 6 new dist/lib/worker/*.js files
  • test/e2e/cpu-profiling: Updated expected CPU profile counts (+1 for build-static-worker profile)

New test coverage:

  • worker-pool.test.ts: 55 tests covering lazy spawning, initialization, dispatch/message handling, task queuing, concurrency, custom messages, end/close, worker exit handling, stdout/stderr, dynamic scaling, fork options, respawning, maxBootingWorkers (throttling, READY signaling, crash recovery, setup error recovery, validation, shutdown)
  • worker.test.ts: 41 tests covering the high-level Worker class (color propagation, option passthrough, exposed methods, end/close lifecycle, env configuration, timeout/activity, exit handler cleanup)

@sokra sokra force-pushed the sokra/static-worker-count branch from df326a8 to 4fb6cc5 Compare February 25, 2026 18:33
@nextjs-bot
Copy link
Collaborator

nextjs-bot commented Feb 25, 2026

Failing test suites

Commit: 5475d6b | About building and testing Next.js

pnpm test-start test/production/app-dir/build-output-prerender/build-output-prerender.test.ts (job)

  • build-output-prerender > with a next config file > without --debug-prerender > shows only a single prerender error with a mangled stack (DD)
Expand output

● build-output-prerender › with a next config file › without --debug-prerender › shows only a single prerender error with a mangled stack

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `build-output-prerender with a next config file without --debug-prerender shows only a single prerender error with a mangled stack 1`

- Snapshot  - 1
+ Received  + 3

@@ -8,6 +8,8 @@
    6 |
  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.
    - Rerun the production build with `next build --debug-prerender` to generate better stack traces.
  Error occurred prerendering page "/client". Read more: https://nextjs.org/docs/messages/prerender-error
- Export encountered an error on /client/page: /client, exiting the build."
+ Export encountered an error on /client/page: /client, exiting the build.
+
+ > Build error occurred"

  71 |         if (isTurbopack) {
  72 |           // TODO(veil): Why is the location incomplete unless we enable --no-mangling?
> 73 |           expect(getPrerenderOutput(next.cliOutput)).toMatchInlineSnapshot(`
     |                                                      ^
  74 |            "Error: Route "/client" used \`new Date()\` inside a Client Component without a Suspense boundary above it. See more info here: https://nextjs.org/docs/messages/next-prerender-current-time-client
  75 |                at <unknown> (app/client/page.tsx:4:28)
  76 |              2 |

  at Object.toMatchInlineSnapshot (production/app-dir/build-output-prerender/build-output-prerender.test.ts:73:54)

pnpm test-start test/production/app-dir/app-fetch-patching/app-fetch-patching.test.ts (job)

  • build-output-prerender > with a next config file > without --debug-prerender > shows only a single prerender error with a mangled stack (DD)
Expand output

● build-output-prerender › with a next config file › without --debug-prerender › shows only a single prerender error with a mangled stack

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `build-output-prerender with a next config file without --debug-prerender shows only a single prerender error with a mangled stack 1`

- Snapshot  - 1
+ Received  + 3

@@ -2,6 +2,8 @@
      at x (<next-dist-dir>)
  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.
    - Rerun the production build with `next build --debug-prerender` to generate better stack traces.
  Error occurred prerendering page "/client". Read more: https://nextjs.org/docs/messages/prerender-error
- Export encountered an error on /client/page: /client, exiting the build."
+ Export encountered an error on /client/page: /client, exiting the build.
+
+ > Build error occurred"

  87 |           `)
  88 |         } else {
> 89 |           expect(getPrerenderOutput(next.cliOutput)).toMatchInlineSnapshot(`
     |                                                      ^
  90 |            "Error: Route "/client" used \`new Date()\` inside a Client Component without a Suspense boundary above it. See more info here: https://nextjs.org/docs/messages/next-prerender-current-time-client
  91 |                at x (<next-dist-dir>)
  92 |            To get a more detailed stack trace and pinpoint the issue, try one of the following:

  at Object.toMatchInlineSnapshot (production/app-dir/build-output-prerender/build-output-prerender.test.ts:89:54)

pnpm test-start test/e2e/app-dir/cache-components-errors/cache-components-errors.test.ts (job)

  • Cache Components Errors > Build Without --prerender-debug > Dynamic Metadata - Error Route > should error the build for the correct reason when there is a cache components violation alongside dynamic metadata (DD)
  • Cache Components Errors > Build Without --prerender-debug > Dynamic Metadata - Static Route > should error the build if generateMetadata is dynamic when the rest of the route is prerenderable (DD)
  • Cache Components Errors > Build Without --prerender-debug > Dynamic Metadata - Static Route With Suspense > should error the build if generateMetadata is dynamic when the rest of the route is prerenderable (DD)
  • Cache Components Errors > Build Without --prerender-debug > Dynamic Root > should error the build if cache components happens in the root (outside a Suspense) (DD)
  • Cache Components Errors > Build Without --prerender-debug > Dynamic Viewport - Dynamic Route > should error the build if generateViewport is dynamic even if there are other uses of dynamic on the page (DD)
  • Cache Components Errors > Build Without --prerender-debug > Dynamic Viewport - Static Route > should error the build if generateViewport is dynamic (DD)
  • Cache Components Errors > Build Without --prerender-debug > Error Attribution with Sync IO > Guarded RSC with unguarded Client sync IO > should error the build with a reason related to sync IO access (DD)
  • Cache Components Errors > Build Without --prerender-debug > Error Attribution with Sync IO > Unguarded RSC with guarded Client sync IO > should error the build with a reason related dynamic data (DD)
  • Cache Components Errors > Build Without --prerender-debug > Error Attribution with Sync IO > unguarded RSC with unguarded Client sync IO > should error the build with a reason related to sync IO access (DD)
  • Cache Components Errors > Build Without --prerender-debug > IO accessed in Client Components > should error the build if IO is accessed in a Client Component (DD)
  • Cache Components Errors > Build Without --prerender-debug > Inside use cache > cacheLife with expire < 5 minutes > microtasky cache > should error the build (DD)
  • Cache Components Errors > Build Without --prerender-debug > Inside use cache > cacheLife with expire < 5 minutes > nested > should error the build (DD)
  • Cache Components Errors > Build Without --prerender-debug > Inside use cache > cacheLife with expire < 5 minutes > slow cache > should error the build (DD)
  • Cache Components Errors > Build Without --prerender-debug > Inside use cache > cacheLife with revalidate: 0 > microtasky cache > should error the build (DD)
  • Cache Components Errors > Build Without --prerender-debug > Inside use cache > cacheLife with revalidate: 0 > nested > should error the build (DD)
  • Cache Components Errors > Build Without --prerender-debug > Inside use cache > cacheLife with revalidate: 0 > slow cache > should error the build (DD)
  • Cache Components Errors > Build Without --prerender-debug > Inside use cache > cookies > should error the build (DD)
  • Cache Components Errors > Build Without --prerender-debug > Inside use cache > draftMode > should error the build (DD)
  • Cache Components Errors > Build Without --prerender-debug > Inside use cache > headers > should error the build (DD)
  • Cache Components Errors > Build Without --prerender-debug > Inside use cache > reading fallback params > should error the build (DD)
  • Cache Components Errors > Build Without --prerender-debug > Sync Dynamic Platform > With Fallback - Math.random() > should error the build if Math.random() happens before some component outside a Suspense boundary is complete (DD)
  • Cache Components Errors > Build Without --prerender-debug > Sync Dynamic Platform > Without Fallback - Math.random() > should error the build if Math.random() happens before some component outside a Suspense boundary is complete (DD)
  • Cache Components Errors > Build Without --prerender-debug > Sync Dynamic Request > cookies > should error the build with a runtime error (DD)
  • Cache Components Errors > Build Without --prerender-debug > Sync Dynamic Request > headers > should error the build with a runtime error (DD)
  • Cache Components Errors > Build Without --prerender-debug > Sync IO - Current Time - Date() > should error the build if sync IO is used in a Server Component while prerendering (DD)
  • Cache Components Errors > Build Without --prerender-debug > Sync IO - Current Time - Date.now() > should error the build if sync IO is used in a Server Component while prerendering (DD)
  • Cache Components Errors > Build Without --prerender-debug > Sync IO - Current Time - new Date() > should error the build if sync IO is used in a Server Component while prerendering (DD)
  • Cache Components Errors > Build Without --prerender-debug > Sync IO - Node Crypto - generateKeyPairSync() > should error the build if sync IO is used in a Server Component while prerendering (DD)
  • Cache Components Errors > Build Without --prerender-debug > Sync IO - Node Crypto - generateKeySync() > should error the build if sync IO is used in a Server Component while prerendering (DD)
  • Cache Components Errors > Build Without --prerender-debug > Sync IO - Node Crypto - generatePrimeSync() > should error the build if sync IO is used in a Server Component while prerendering (DD)
  • Cache Components Errors > Build Without --prerender-debug > Sync IO - Node Crypto - getRandomValues() > should error the build if sync IO is used in a Server Component while prerendering (DD)
  • Cache Components Errors > Build Without --prerender-debug > Sync IO - Node Crypto - random-bytes() > should error the build if sync IO is used in a Server Component while prerendering (DD)
  • Cache Components Errors > Build Without --prerender-debug > Sync IO - Node Crypto - random-fill-sync() > should error the build if sync IO is used in a Server Component while prerendering (DD)
  • Cache Components Errors > Build Without --prerender-debug > Sync IO - Node Crypto - random-int-between() > should error the build if sync IO is used in a Server Component while prerendering (DD)
  • Cache Components Errors > Build Without --prerender-debug > Sync IO - Node Crypto - random-int-up-to() > should error the build if sync IO is used in a Server Component while prerendering (DD)
  • Cache Components Errors > Build Without --prerender-debug > Sync IO - Node Crypto - random-uuid > should error the build if sync IO is used in a Server Component while prerendering (DD)
  • Cache Components Errors > Build Without --prerender-debug > Sync IO - Random - Math.random() > should error the build if sync IO is used in a Server Component while prerendering (DD)
  • Cache Components Errors > Build Without --prerender-debug > Sync IO - Web Crypto - getRandomValue() > should error the build if sync IO is used in a Server Component while prerendering (DD)
  • Cache Components Errors > Build Without --prerender-debug > Sync IO - Web Crypto - randomUUID() > should error the build if sync IO is used in a Server Component while prerendering (DD)
  • Cache Components Errors > Build Without --prerender-debug > With use cache: private > in unstable_cache > should error the build (DD)
  • Cache Components Errors > Build Without --prerender-debug > With use cache: private > in use cache > should error the build (DD)
  • Cache Components Errors > Build Without --prerender-debug > With use cache: private > without Suspense > should error the build (DD)
Expand output

● Cache Components Errors › Build Without --prerender-debug › Dynamic Metadata - Static Route › should error the build if generateMetadata is dynamic when the rest of the route is prerenderable

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Cache Components Errors Build Without --prerender-debug Dynamic Metadata - Static Route should error the build if generateMetadata is dynamic when the rest of the route is prerenderable 1`

- Snapshot  - 1
+ Received  + 3

  "Route "/dynamic-metadata-static-route" has a `generateMetadata` that depends on Request data (`cookies()`, etc...) or uncached external data (`fetch(...)`, etc...) when the rest of the route does not. See more info here: https://nextjs.org/docs/messages/next-prerender-dynamic-metadata
  Error occurred prerendering page "/dynamic-metadata-static-route". Read more: https://nextjs.org/docs/messages/prerender-error
- Export encountered an error on /dynamic-metadata-static-route/page: /dynamic-metadata-static-route, exiting the build."
+ Export encountered an error on /dynamic-metadata-static-route/page: /dynamic-metadata-static-route, exiting the build.
+
+ > Build error occurred"

  133 |               `)
  134 |           } else {
> 135 |             expect(output).toMatchInlineSnapshot(`
      |                            ^
  136 |                "Route "/dynamic-metadata-static-route" has a \`generateMetadata\` that depends on Request data (\`cookies()\`, etc...) or uncached external data (\`fetch(...)\`, etc...) when the rest of the route does not. See more info here: https://nextjs.org/docs/messages/next-prerender-dynamic-metadata
  137 |                Error occurred prerendering page "/dynamic-metadata-static-route". Read more: https://nextjs.org/docs/messages/prerender-error
  138 |                Export encountered an error on /dynamic-metadata-static-route/page: /dynamic-metadata-static-route, exiting the build."

  at Object.toMatchInlineSnapshot (e2e/app-dir/cache-components-errors/cache-components-errors.test.ts:135:28)

● Cache Components Errors › Build Without --prerender-debug › Dynamic Metadata - Error Route › should error the build for the correct reason when there is a cache components violation alongside dynamic metadata

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Cache Components Errors Build Without --prerender-debug Dynamic Metadata - Error Route should error the build for the correct reason when there is a cache components violation alongside dynamic metadata 1`

- Snapshot  - 1
+ Received  + 3

@@ -25,6 +25,8 @@
      at u (<next-dist-dir>)
  To get a more detailed stack trace and pinpoint the issue, try one of the following:
    - Start the app in development mode by running `next dev`, then open "/dynamic-metadata-error-route" in your browser to investigate the error.
    - Rerun the production build with `next build --debug-prerender` to generate better stack traces.
  Error occurred prerendering page "/dynamic-metadata-error-route". Read more: https://nextjs.org/docs/messages/prerender-error
- Export encountered an error on /dynamic-metadata-error-route/page: /dynamic-metadata-error-route, exiting the build."
+ Export encountered an error on /dynamic-metadata-error-route/page: /dynamic-metadata-error-route, exiting the build.
+
+ > Build error occurred"

  243 |               `)
  244 |             } else {
> 245 |               expect(output).toMatchInlineSnapshot(`
      |                              ^
  246 |                "Error: Route "/dynamic-metadata-error-route": Uncached data was accessed outside of <Suspense>. This delays the entire page from rendering, resulting in a slow user experience. Learn more: https://nextjs.org/docs/messages/blocking-route
  247 |                    at a (<next-dist-dir>)
  248 |                    at b (<next-dist-dir>)

  at Object.toMatchInlineSnapshot (e2e/app-dir/cache-components-errors/cache-components-errors.test.ts:245:30)

● Cache Components Errors › Build Without --prerender-debug › Dynamic Metadata - Static Route With Suspense › should error the build if generateMetadata is dynamic when the rest of the route is prerenderable

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Cache Components Errors Build Without --prerender-debug Dynamic Metadata - Static Route With Suspense should error the build if generateMetadata is dynamic when the rest of the route is prerenderable 1`

- Snapshot  - 1
+ Received  + 3

  "Route "/dynamic-metadata-static-with-suspense" has a `generateMetadata` that depends on Request data (`cookies()`, etc...) or uncached external data (`fetch(...)`, etc...) when the rest of the route does not. See more info here: https://nextjs.org/docs/messages/next-prerender-dynamic-metadata
  Error occurred prerendering page "/dynamic-metadata-static-with-suspense". Read more: https://nextjs.org/docs/messages/prerender-error
- Export encountered an error on /dynamic-metadata-static-with-suspense/page: /dynamic-metadata-static-with-suspense, exiting the build."
+ Export encountered an error on /dynamic-metadata-static-with-suspense/page: /dynamic-metadata-static-with-suspense, exiting the build.
+
+ > Build error occurred"

  336 |               `)
  337 |           } else {
> 338 |             expect(output).toMatchInlineSnapshot(`
      |                            ^
  339 |                "Route "/dynamic-metadata-static-with-suspense" has a \`generateMetadata\` that depends on Request data (\`cookies()\`, etc...) or uncached external data (\`fetch(...)\`, etc...) when the rest of the route does not. See more info here: https://nextjs.org/docs/messages/next-prerender-dynamic-metadata
  340 |                Error occurred prerendering page "/dynamic-metadata-static-with-suspense". Read more: https://nextjs.org/docs/messages/prerender-error
  341 |                Export encountered an error on /dynamic-metadata-static-with-suspense/page: /dynamic-metadata-static-with-suspense, exiting the build."

  at Object.toMatchInlineSnapshot (e2e/app-dir/cache-components-errors/cache-components-errors.test.ts:338:28)

● Cache Components Errors › Build Without --prerender-debug › Dynamic Viewport - Static Route › should error the build if generateViewport is dynamic

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Cache Components Errors Build Without --prerender-debug Dynamic Viewport - Static Route should error the build if generateViewport is dynamic 1`

- Snapshot  - 1
+ Received  + 3

  "Route "/dynamic-viewport-static-route" has a `generateViewport` that depends on Request data (`cookies()`, etc...) or uncached external data (`fetch(...)`, etc...) without explicitly allowing fully dynamic rendering. See more info here: https://nextjs.org/docs/messages/next-prerender-dynamic-viewport
  Error occurred prerendering page "/dynamic-viewport-static-route". Read more: https://nextjs.org/docs/messages/prerender-error
- Export encountered an error on /dynamic-viewport-static-route/page: /dynamic-viewport-static-route, exiting the build."
+ Export encountered an error on /dynamic-viewport-static-route/page: /dynamic-viewport-static-route, exiting the build.
+
+ > Build error occurred"

  426 |             `)
  427 |           } else {
> 428 |             expect(output).toMatchInlineSnapshot(`
      |                            ^
  429 |                "Route "/dynamic-viewport-static-route" has a \`generateViewport\` that depends on Request data (\`cookies()\`, etc...) or uncached external data (\`fetch(...)\`, etc...) without explicitly allowing fully dynamic rendering. See more info here: https://nextjs.org/docs/messages/next-prerender-dynamic-viewport
  430 |                Error occurred prerendering page "/dynamic-viewport-static-route". Read more: https://nextjs.org/docs/messages/prerender-error
  431 |                Export encountered an error on /dynamic-viewport-static-route/page: /dynamic-viewport-static-route, exiting the build."

  at Object.toMatchInlineSnapshot (e2e/app-dir/cache-components-errors/cache-components-errors.test.ts:428:28)

● Cache Components Errors › Build Without --prerender-debug › Dynamic Viewport - Dynamic Route › should error the build if generateViewport is dynamic even if there are other uses of dynamic on the page

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Cache Components Errors Build Without --prerender-debug Dynamic Viewport - Dynamic Route should error the build if generateViewport is dynamic even if there are other uses of dynamic on the page 1`

- Snapshot  - 1
+ Received  + 3

  "Route "/dynamic-viewport-dynamic-route" has a `generateViewport` that depends on Request data (`cookies()`, etc...) or uncached external data (`fetch(...)`, etc...) without explicitly allowing fully dynamic rendering. See more info here: https://nextjs.org/docs/messages/next-prerender-dynamic-viewport
  Error occurred prerendering page "/dynamic-viewport-dynamic-route". Read more: https://nextjs.org/docs/messages/prerender-error
- Export encountered an error on /dynamic-viewport-dynamic-route/page: /dynamic-viewport-dynamic-route, exiting the build."
+ Export encountered an error on /dynamic-viewport-dynamic-route/page: /dynamic-viewport-dynamic-route, exiting the build.
+
+ > Build error occurred"

  491 |             `)
  492 |           } else {
> 493 |             expect(output).toMatchInlineSnapshot(`
      |                            ^
  494 |                "Route "/dynamic-viewport-dynamic-route" has a \`generateViewport\` that depends on Request data (\`cookies()\`, etc...) or uncached external data (\`fetch(...)\`, etc...) without explicitly allowing fully dynamic rendering. See more info here: https://nextjs.org/docs/messages/next-prerender-dynamic-viewport
  495 |                Error occurred prerendering page "/dynamic-viewport-dynamic-route". Read more: https://nextjs.org/docs/messages/prerender-error
  496 |                Export encountered an error on /dynamic-viewport-dynamic-route/page: /dynamic-viewport-dynamic-route, exiting the build."

  at Object.toMatchInlineSnapshot (e2e/app-dir/cache-components-errors/cache-components-errors.test.ts:493:28)

● Cache Components Errors › Build Without --prerender-debug › Dynamic Root › should error the build if cache components happens in the root (outside a Suspense)

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Cache Components Errors Build Without --prerender-debug Dynamic Root should error the build if cache components happens in the root (outside a Suspense) 1`

- Snapshot  - 1
+ Received  + 3

@@ -54,6 +54,8 @@
      at q (<next-dist-dir>)
  To get a more detailed stack trace and pinpoint the issue, try one of the following:
    - Start the app in development mode by running `next dev`, then open "/dynamic-root" in your browser to investigate the error.
    - Rerun the production build with `next build --debug-prerender` to generate better stack traces.
  Error occurred prerendering page "/dynamic-root". Read more: https://nextjs.org/docs/messages/prerender-error
- Export encountered an error on /dynamic-root/page: /dynamic-root, exiting the build."
+ Export encountered an error on /dynamic-root/page: /dynamic-root, exiting the build.
+
+ > Build error occurred"

  688 |               `)
  689 |             } else {
> 690 |               expect(output).toMatchInlineSnapshot(`
      |                              ^
  691 |                "Error: Route "/dynamic-root": Uncached data was accessed outside of <Suspense>. This delays the entire page from rendering, resulting in a slow user experience. Learn more: https://nextjs.org/docs/messages/blocking-route
  692 |                    at a (<next-dist-dir>)
  693 |                    at b (<next-dist-dir>)

  at Object.toMatchInlineSnapshot (e2e/app-dir/cache-components-errors/cache-components-errors.test.ts:690:30)

● Cache Components Errors › Build Without --prerender-debug › Sync Dynamic Platform › With Fallback - Math.random() › should error the build if Math.random() happens before some component outside a Suspense boundary is complete

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Cache Components Errors Build Without --prerender-debug Sync Dynamic Platform With Fallback - Math.random() should error the build if Math.random() happens before some component outside a Suspense boundary is complete 1`

- Snapshot  - 1
+ Received  + 3

@@ -2,6 +2,8 @@
      at a (<next-dist-dir>)
  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.
    - Rerun the production build with `next build --debug-prerender` to generate better stack traces.
  Error occurred prerendering page "/sync-random-with-fallback". Read more: https://nextjs.org/docs/messages/prerender-error
- Export encountered an error on /sync-random-with-fallback/page: /sync-random-with-fallback, exiting the build."
+ Export encountered an error on /sync-random-with-fallback/page: /sync-random-with-fallback, exiting the build.
+
+ > Build error occurred"

  876 |                 `)
  877 |               } else {
> 878 |                 expect(output).toMatchInlineSnapshot(`
      |                                ^
  879 |                  "Error: Route "/sync-random-with-fallback" used \`Math.random()\` before accessing either uncached data (e.g. \`fetch()\`) or Request data (e.g. \`cookies()\`, \`headers()\`, \`connection()\`, and \`searchParams\`). Accessing random values synchronously in a Server Component requires reading one of these data sources first. Alternatively, consider moving this expression into a Client Component or Cache Component. See more info here: https://nextjs.org/docs/messages/next-prerender-random
  880 |                      at a (<next-dist-dir>)
  881 |                  To get a more detailed stack trace and pinpoint the issue, try one of the following:

  at Object.toMatchInlineSnapshot (e2e/app-dir/cache-components-errors/cache-components-errors.test.ts:878:32)

● Cache Components Errors › Build Without --prerender-debug › Sync Dynamic Platform › Without Fallback - Math.random() › should error the build if Math.random() happens before some component outside a Suspense boundary is complete

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Cache Components Errors Build Without --prerender-debug Sync Dynamic Platform Without Fallback - Math.random() should error the build if Math.random() happens before some component outside a Suspense boundary is complete 1`

- Snapshot  - 1
+ Received  + 3

@@ -2,6 +2,8 @@
      at a (<next-dist-dir>)
  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.
    - Rerun the production build with `next build --debug-prerender` to generate better stack traces.
  Error occurred prerendering page "/sync-random-without-fallback". Read more: https://nextjs.org/docs/messages/prerender-error
- Export encountered an error on /sync-random-without-fallback/page: /sync-random-without-fallback, exiting the build."
+ Export encountered an error on /sync-random-without-fallback/page: /sync-random-without-fallback, exiting the build.
+
+ > Build error occurred"

  990 |                 `)
  991 |               } else {
> 992 |                 expect(output).toMatchInlineSnapshot(`
      |                                ^
  993 |                  "Error: Route "/sync-random-without-fallback" used \`Math.random()\` before accessing either uncached data (e.g. \`fetch()\`) or Request data (e.g. \`cookies()\`, \`headers()\`, \`connection()\`, and \`searchParams\`). Accessing random values synchronously in a Server Component requires reading one of these data sources first. Alternatively, consider moving this expression into a Client Component or Cache Component. See more info here: https://nextjs.org/docs/messages/next-prerender-random
  994 |                      at a (<next-dist-dir>)
  995 |                  To get a more detailed stack trace and pinpoint the issue, try one of the following:

  at Object.toMatchInlineSnapshot (e2e/app-dir/cache-components-errors/cache-components-errors.test.ts:992:32)

● Cache Components Errors › Build Without --prerender-debug › Sync Dynamic Request › cookies › should error the build with a runtime error

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Cache Components Errors Build Without --prerender-debug Sync Dynamic Request cookies should error the build with a runtime error 1`

- Snapshot  - 1
+ Received  + 3

@@ -2,6 +2,8 @@
  TypeError: <module-function>().get is not a function
      at a (<next-dist-dir>)
      at b (<anonymous>) {
    digest: '<error-digest>'
  }
- Export encountered an error on /sync-cookies/page: /sync-cookies, exiting the build."
+ Export encountered an error on /sync-cookies/page: /sync-cookies, exiting the build.
+
+ > Build error occurred"

  1248 |                 `)
  1249 |               } else {
> 1250 |                 expect(output).toMatchInlineSnapshot(`
       |                                ^
  1251 |                  "Error occurred prerendering page "/sync-cookies". Read more: https://nextjs.org/docs/messages/prerender-error
  1252 |                  TypeError: <module-function>().get is not a function
  1253 |                      at a (<next-dist-dir>)

  at Object.toMatchInlineSnapshot (e2e/app-dir/cache-components-errors/cache-components-errors.test.ts:1250:32)

● Cache Components Errors › Build Without --prerender-debug › Sync Dynamic Request › headers › should error the build with a runtime error

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Cache Components Errors Build Without --prerender-debug Sync Dynamic Request headers should error the build with a runtime error 1`

- Snapshot  - 1
+ Received  + 3

@@ -2,6 +2,8 @@
  TypeError: <module-function>().get is not a function
      at a (<next-dist-dir>)
      at b (<anonymous>) {
    digest: '<error-digest>'
  }
- Export encountered an error on /sync-headers/page: /sync-headers, exiting the build."
+ Export encountered an error on /sync-headers/page: /sync-headers, exiting the build.
+
+ > Build error occurred"

  1582 |                 `)
  1583 |               } else {
> 1584 |                 expect(output).toMatchInlineSnapshot(`
       |                                ^
  1585 |                  "Error occurred prerendering page "/sync-headers". Read more: https://nextjs.org/docs/messages/prerender-error
  1586 |                  TypeError: <module-function>().get is not a function
  1587 |                      at a (<next-dist-dir>)

  at Object.toMatchInlineSnapshot (e2e/app-dir/cache-components-errors/cache-components-errors.test.ts:1584:32)

● Cache Components Errors › Build Without --prerender-debug › Error Attribution with Sync IO › Guarded RSC with unguarded Client sync IO › should error the build with a reason related to sync IO access

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Cache Components Errors Build Without --prerender-debug Error Attribution with Sync IO Guarded RSC with unguarded Client sync IO should error the build with a reason related to sync IO access 1`

- Snapshot  - 1
+ Received  + 3

@@ -2,6 +2,8 @@
      at a (<next-dist-dir>)
  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-attribution/guarded-async-unguarded-clientsync" in your browser to investigate the error.
    - Rerun the production build with `next build --debug-prerender` to generate better stack traces.
  Error occurred prerendering page "/sync-attribution/guarded-async-unguarded-clientsync". Read more: https://nextjs.org/docs/messages/prerender-error
- Export encountered an error on /sync-attribution/guarded-async-unguarded-clientsync/page: /sync-attribution/guarded-async-unguarded-clientsync, exiting the build."
+ Export encountered an error on /sync-attribution/guarded-async-unguarded-clientsync/page: /sync-attribution/guarded-async-unguarded-clientsync, exiting the build.
+
+ > Build error occurred"

  1888 |                 `)
  1889 |               } else {
> 1890 |                 expect(output).toMatchInlineSnapshot(`
       |                                ^
  1891 |                  "Error: Route "/sync-attribution/guarded-async-unguarded-clientsync" used \`new Date()\` inside a Client Component without a Suspense boundary above it. See more info here: https://nextjs.org/docs/messages/next-prerender-current-time-client
  1892 |                      at a (<next-dist-dir>)
  1893 |                  To get a more detailed stack trace and pinpoint the issue, try one of the following:

  at Object.toMatchInlineSnapshot (e2e/app-dir/cache-components-errors/cache-components-errors.test.ts:1890:32)

● Cache Components Errors › Build Without --prerender-debug › Error Attribution with Sync IO › Unguarded RSC with guarded Client sync IO › should error the build with a reason related dynamic data

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Cache Components Errors Build Without --prerender-debug Error Attribution with Sync IO Unguarded RSC with guarded Client sync IO should error the build with a reason related dynamic data 1`

- Snapshot  - 1
+ Received  + 3

@@ -37,6 +37,8 @@
      at f (<next-dist-dir>)
  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-attribution/unguarded-async-guarded-clientsync" in your browser to investigate the error.
    - Rerun the production build with `next build --debug-prerender` to generate better stack traces.
  Error occurred prerendering page "/sync-attribution/unguarded-async-guarded-clientsync". Read more: https://nextjs.org/docs/messages/prerender-error
- Export encountered an error on /sync-attribution/unguarded-async-guarded-clientsync/page: /sync-attribution/unguarded-async-guarded-clientsync, exiting the build."
+ Export encountered an error on /sync-attribution/unguarded-async-guarded-clientsync/page: /sync-attribution/unguarded-async-guarded-clientsync, exiting the build.
+
+ > Build error occurred"

  2010 |                 `)
  2011 |               } else {
> 2012 |                 expect(output).toMatchInlineSnapshot(`
       |                                ^
  2013 |                  "Error: Route "/sync-attribution/unguarded-async-guarded-clientsync": Uncached data was accessed outside of <Suspense>. This delays the entire page from rendering, resulting in a slow user experience. Learn more: https://nextjs.org/docs/messages/blocking-route
  2014 |                      at a (<anonymous>)
  2015 |                      at main (<anonymous>)

  at Object.toMatchInlineSnapshot (e2e/app-dir/cache-components-errors/cache-components-errors.test.ts:2012:32)

● Cache Components Errors › Build Without --prerender-debug › Error Attribution with Sync IO › unguarded RSC with unguarded Client sync IO › should error the build with a reason related to sync IO access

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Cache Components Errors Build Without --prerender-debug Error Attribution with Sync IO unguarded RSC with unguarded Client sync IO should error the build with a reason related to sync IO access 1`

- Snapshot  - 1
+ Received  + 3

@@ -2,6 +2,8 @@
      at a (<next-dist-dir>)
  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-attribution/unguarded-async-unguarded-clientsync" in your browser to investigate the error.
    - Rerun the production build with `next build --debug-prerender` to generate better stack traces.
  Error occurred prerendering page "/sync-attribution/unguarded-async-unguarded-clientsync". Read more: https://nextjs.org/docs/messages/prerender-error
- Export encountered an error on /sync-attribution/unguarded-async-unguarded-clientsync/page: /sync-attribution/unguarded-async-unguarded-clientsync, exiting the build."
+ Export encountered an error on /sync-attribution/unguarded-async-unguarded-clientsync/page: /sync-attribution/unguarded-async-unguarded-clientsync, exiting the build.
+
+ > Build error occurred"

  2157 |                 `)
  2158 |               } else {
> 2159 |                 expect(output).toMatchInlineSnapshot(`
       |                                ^
  2160 |                  "Error: Route "/sync-attribution/unguarded-async-unguarded-clientsync" used \`new Date()\` inside a Client Component without a Suspense boundary above it. See more info here: https://nextjs.org/docs/messages/next-prerender-current-time-client
  2161 |                      at a (<next-dist-dir>)
  2162 |                  To get a more detailed stack trace and pinpoint the issue, try one of the following:

  at Object.toMatchInlineSnapshot (e2e/app-dir/cache-components-errors/cache-components-errors.test.ts:2159:32)

● Cache Components Errors › Build Without --prerender-debug › Inside use cache › cookies › should error the build

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Cache Components Errors Build Without --prerender-debug Inside \`use cache\` cookies should error the build 1`

- Snapshot  - 1
+ Received  + 3

@@ -3,6 +3,8 @@
      at b (<next-dist-dir>)
  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 "/use-cache-cookies" in your browser to investigate the error.
    - Rerun the production build with `next build --debug-prerender` to generate better stack traces.
  Error occurred prerendering page "/use-cache-cookies". Read more: https://nextjs.org/docs/messages/prerender-error
- Export encountered an error on /use-cache-cookies/page: /use-cache-cookies, exiting the build."
+ Export encountered an error on /use-cache-cookies/page: /use-cache-cookies, exiting the build.
+
+ > Build error occurred"

  2263 |                 `)
  2264 |               } else {
> 2265 |                 expect(output).toMatchInlineSnapshot(`
       |                                ^
  2266 |                  "Error: Route /use-cache-cookies used \`cookies()\` inside "use cache". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \`cookies()\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache
  2267 |                      at a (<next-dist-dir>)
  2268 |                      at b (<next-dist-dir>)

  at Object.toMatchInlineSnapshot (e2e/app-dir/cache-components-errors/cache-components-errors.test.ts:2265:32)

● Cache Components Errors › Build Without --prerender-debug › Inside use cache › draftMode › should error the build

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Cache Components Errors Build Without --prerender-debug Inside \`use cache\` draftMode should error the build 1`

- Snapshot  - 1
+ Received  + 3

@@ -2,6 +2,8 @@
      at a (<next-dist-dir>)
  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 "/use-cache-draft-mode" in your browser to investigate the error.
    - Rerun the production build with `next build --debug-prerender` to generate better stack traces.
  Error occurred prerendering page "/use-cache-draft-mode". Read more: https://nextjs.org/docs/messages/prerender-error
- Export encountered an error on /use-cache-draft-mode/page: /use-cache-draft-mode, exiting the build."
+ Export encountered an error on /use-cache-draft-mode/page: /use-cache-draft-mode, exiting the build.
+
+ > Build error occurred"

  2368 |                 `)
  2369 |               } else {
> 2370 |                 expect(output).toMatchInlineSnapshot(`
       |                                ^
  2371 |                  "Error: Route /use-cache-draft-mode used "draftMode().enable()" inside "use cache". The enabled status of \`draftMode()\` can be read in caches but you must not enable or disable \`draftMode()\` inside a cache. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache
  2372 |                      at a (<next-dist-dir>)
  2373 |                  To get a more detailed stack trace and pinpoint the issue, try one of the following:

  at Object.toMatchInlineSnapshot (e2e/app-dir/cache-components-errors/cache-components-errors.test.ts:2370:32)

● Cache Components Errors › Build Without --prerender-debug › Inside use cache › headers › should error the build

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Cache Components Errors Build Without --prerender-debug Inside \`use cache\` headers should error the build 1`

- Snapshot  - 1
+ Received  + 3

@@ -3,6 +3,8 @@
      at b (<next-dist-dir>)
  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 "/use-cache-headers" in your browser to investigate the error.
    - Rerun the production build with `next build --debug-prerender` to generate better stack traces.
  Error occurred prerendering page "/use-cache-headers". Read more: https://nextjs.org/docs/messages/prerender-error
- Export encountered an error on /use-cache-headers/page: /use-cache-headers, exiting the build."
+ Export encountered an error on /use-cache-headers/page: /use-cache-headers, exiting the build.
+
+ > Build error occurred"

  2472 |                 `)
  2473 |               } else {
> 2474 |                 expect(output).toMatchInlineSnapshot(`
       |                                ^
  2475 |                  "Error: Route /use-cache-headers used \`headers()\` inside "use cache". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \`headers()\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache
  2476 |                      at a (<next-dist-dir>)
  2477 |                      at b (<next-dist-dir>)

  at Object.toMatchInlineSnapshot (e2e/app-dir/cache-components-errors/cache-components-errors.test.ts:2474:32)

● Cache Components Errors › Build Without --prerender-debug › Inside use cache › cacheLife with expire < 5 minutes › microtasky cache › should error the build

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Cache Components Errors Build Without --prerender-debug Inside \`use cache\` cacheLife with expire < 5 minutes microtasky cache should error the build 1`

- Snapshot  - 1
+ Received  + 3

@@ -35,6 +35,8 @@
      at e (<next-dist-dir>)
  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 "/use-cache-low-expire/fast" in your browser to investigate the error.
    - Rerun the production build with `next build --debug-prerender` to generate better stack traces.
  Error occurred prerendering page "/use-cache-low-expire/fast". Read more: https://nextjs.org/docs/messages/prerender-error
- Export encountered an error on /use-cache-low-expire/fast/page: /use-cache-low-expire/fast, exiting the build."
+ Export encountered an error on /use-cache-low-expire/fast/page: /use-cache-low-expire/fast, exiting the build.
+
+ > Build error occurred"

  2575 |                   )
  2576 |                 } else {
> 2577 |                   expect(output).toMatchInlineSnapshot(`
       |                                  ^
  2578 |                    "Error: Route "/use-cache-low-expire/fast": Uncached data was accessed outside of <Suspense>. This delays the entire page from rendering, resulting in a slow user experience. Learn more: https://nextjs.org/docs/messages/blocking-route
  2579 |                        at a (<next-dist-dir>)
  2580 |                        at b (<next-dist-dir>)

  at Object.toMatchInlineSnapshot (e2e/app-dir/cache-components-errors/cache-components-errors.test.ts:2577:34)

● Cache Components Errors › Build Without --prerender-debug › Inside use cache › cacheLife with expire < 5 minutes › slow cache › should error the build

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Cache Components Errors Build Without --prerender-debug Inside \`use cache\` cacheLife with expire < 5 minutes slow cache should error the build 1`

- Snapshot  - 1
+ Received  + 3

@@ -35,6 +35,8 @@
      at e (<next-dist-dir>)
  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 "/use-cache-low-expire/slow" in your browser to investigate the error.
    - Rerun the production build with `next build --debug-prerender` to generate better stack traces.
  Error occurred prerendering page "/use-cache-low-expire/slow". Read more: https://nextjs.org/docs/messages/prerender-error
- Export encountered an error on /use-cache-low-expire/slow/page: /use-cache-low-expire/slow, exiting the build."
+ Export encountered an error on /use-cache-low-expire/slow/page: /use-cache-low-expire/slow, exiting the build.
+
+ > Build error occurred"

  2709 |                   )
  2710 |                 } else {
> 2711 |                   expect(output).toMatchInlineSnapshot(`
       |                                  ^
  2712 |                    "Error: Route "/use-cache-low-expire/slow": Uncached data was accessed outside of <Suspense>. This delays the entire page from rendering, resulting in a slow user experience. Learn more: https://nextjs.org/docs/messages/blocking-route
  2713 |                        at a (<next-dist-dir>)
  2714 |                        at b (<next-dist-dir>)

  at Object.toMatchInlineSnapshot (e2e/app-dir/cache-components-errors/cache-components-errors.test.ts:2711:34)

● Cache Components Errors › Build Without --prerender-debug › Inside use cache › cacheLife with expire < 5 minutes › nested › should error the build

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Cache Components Errors Build Without --prerender-debug Inside \`use cache\` cacheLife with expire < 5 minutes nested should error the build 1`

- Snapshot  - 1
+ Received  + 3

@@ -2,6 +2,8 @@
      at a (<next-dist-dir>)
  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 "/use-cache-low-expire/nested" in your browser to investigate the error.
    - Rerun the production build with `next build --debug-prerender` to generate better stack traces.
  Error occurred prerendering page "/use-cache-low-expire/nested". Read more: https://nextjs.org/docs/messages/prerender-error
- Export encountered an error on /use-cache-low-expire/nested/page: /use-cache-low-expire/nested, exiting the build."
+ Export encountered an error on /use-cache-low-expire/nested/page: /use-cache-low-expire/nested, exiting the build.
+
+ > Build error occurred"

  2844 |                   `)
  2845 |                 } else {
> 2846 |                   expect(output).toMatchInlineSnapshot(`
       |                                  ^
  2847 |                    "Error: A "use cache" with short \`expire\` (under 5 minutes) is nested inside another "use cache" that has no explicit \`cacheLife\`, which is not allowed during prerendering. Add \`cacheLife()\` to the outer \`"use cache"\` to choose whether it should be prerendered (with longer \`expire\`) or remain dynamic (with short \`expire\`). Read more: https://nextjs.org/docs/messages/nested-use-cache-no-explicit-cachelife
  2848 |                        at a (<next-dist-dir>)
  2849 |                    To get a more detailed stack trace and pinpoint the issue, try one of the following:

  at Object.toMatchInlineSnapshot (e2e/app-dir/cache-components-errors/cache-components-errors.test.ts:2846:34)

● Cache Components Errors › Build Without --prerender-debug › Inside use cache › cacheLife with revalidate: 0 › microtasky cache › should error the build

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Cache Components Errors Build Without --prerender-debug Inside \`use cache\` cacheLife with revalidate: 0 microtasky cache should error the build 1`

- Snapshot  - 1
+ Received  + 3

@@ -35,6 +35,8 @@
      at e (<next-dist-dir>)
  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 "/use-cache-revalidate-0/fast" in your browser to investigate the error.
    - Rerun the production build with `next build --debug-prerender` to generate better stack traces.
  Error occurred prerendering page "/use-cache-revalidate-0/fast". Read more: https://nextjs.org/docs/messages/prerender-error
- Export encountered an error on /use-cache-revalidate-0/fast/page: /use-cache-revalidate-0/fast, exiting the build."
+ Export encountered an error on /use-cache-revalidate-0/fast/page: /use-cache-revalidate-0/fast, exiting the build.
+
+ > Build error occurred"

  2947 |                   )
  2948 |                 } else {
> 2949 |                   expect(output).toMatchInlineSnapshot(`
       |                                  ^
  2950 |                    "Error: Route "/use-cache-revalidate-0/fast": Uncached data was accessed outside of <Suspense>. This delays the entire page from rendering, resulting in a slow user experience. Learn more: https://nextjs.org/docs/messages/blocking-route
  2951 |                        at a (<next-dist-dir>)
  2952 |                        at b (<next-dist-dir>)

  at Object.toMatchInlineSnapshot (e2e/app-dir/cache-components-errors/cache-components-errors.test.ts:2949:34)

● Cache Components Errors › Build Without --prerender-debug › Inside use cache › cacheLife with revalidate: 0 › slow cache › should error the build

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Cache Components Errors Build Without --prerender-debug Inside \`use cache\` cacheLife with revalidate: 0 slow cache should error the build 1`

- Snapshot  - 1
+ Received  + 3

@@ -35,6 +35,8 @@
      at e (<next-dist-dir>)
  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 "/use-cache-revalidate-0/slow" in your browser to investigate the error.
    - Rerun the production build with `next build --debug-prerender` to generate better stack traces.
  Error occurred prerendering page "/use-cache-revalidate-0/slow". Read more: https://nextjs.org/docs/messages/prerender-error
- Export encountered an error on /use-cache-revalidate-0/slow/page: /use-cache-revalidate-0/slow, exiting the build."
+ Export encountered an error on /use-cache-revalidate-0/slow/page: /use-cache-revalidate-0/slow, exiting the build.
+
+ > Build error occurred"

  3081 |                   )
  3082 |                 } else {
> 3083 |                   expect(output).toMatchInlineSnapshot(`
       |                                  ^
  3084 |                    "Error: Route "/use-cache-revalidate-0/slow": Uncached data was accessed outside of <Suspense>. This delays the entire page from rendering, resulting in a slow user experience. Learn more: https://nextjs.org/docs/messages/blocking-route
  3085 |                        at a (<next-dist-dir>)
  3086 |                        at b (<next-dist-dir>)

  at Object.toMatchInlineSnapshot (e2e/app-dir/cache-components-errors/cache-components-errors.test.ts:3083:34)

● Cache Components Errors › Build Without --prerender-debug › Inside use cache › cacheLife with revalidate: 0 › nested › should error the build

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Cache Components Errors Build Without --prerender-debug Inside \`use cache\` cacheLife with revalidate: 0 nested should error the build 1`

- Snapshot  - 1
+ Received  + 3

@@ -2,6 +2,8 @@
      at a (<next-dist-dir>)
  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 "/use-cache-revalidate-0/nested" in your browser to investigate the error.
    - Rerun the production build with `next build --debug-prerender` to generate better stack traces.
  Error occurred prerendering page "/use-cache-revalidate-0/nested". Read more: https://nextjs.org/docs/messages/prerender-error
- Export encountered an error on /use-cache-revalidate-0/nested/page: /use-cache-revalidate-0/nested, exiting the build."
+ Export encountered an error on /use-cache-revalidate-0/nested/page: /use-cache-revalidate-0/nested, exiting the build.
+
+ > Build error occurred"

  3218 |                   `)
  3219 |                 } else {
> 3220 |                   expect(output).toMatchInlineSnapshot(`
       |                                  ^
  3221 |                    "Error: A "use cache" with zero \`revalidate\` is nested inside another "use cache" that has no explicit \`cacheLife\`, which is not allowed during prerendering. Add \`cacheLife()\` to the outer \`"use cache"\` to choose whether it should be prerendered (with non-zero \`revalidate\`) or remain dynamic (with zero \`revalidate\`). Read more: https://nextjs.org/docs/messages/nested-use-cache-no-explicit-cachelife
  3222 |                        at a (<next-dist-dir>)
  3223 |                    To get a more detailed stack trace and pinpoint the issue, try one of the following:

  at Object.toMatchInlineSnapshot (e2e/app-dir/cache-components-errors/cache-components-errors.test.ts:3220:34)

● Cache Components Errors › Build Without --prerender-debug › Inside use cache › reading fallback params › should error the build

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Cache Components Errors Build Without --prerender-debug Inside \`use cache\` reading fallback params should error the build 1`

- Snapshot  - 1
+ Received  + 3

@@ -35,6 +35,8 @@
      at e (<next-dist-dir>)
  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 "/use-cache-params/[slug]" in your browser to investigate the error.
    - Rerun the production build with `next build --debug-prerender` to generate better stack traces.
  Error occurred prerendering page "/use-cache-params/[slug]". Read more: https://nextjs.org/docs/messages/prerender-error
- Export encountered an error on /use-cache-params/[slug]/page: /use-cache-params/[slug], exiting the build."
+ Export encountered an error on /use-cache-params/[slug]/page: /use-cache-params/[slug], exiting the build.
+
+ > Build error occurred"

  3319 |                 `)
  3320 |               } else {
> 3321 |                 expect(output).toMatchInlineSnapshot(`
       |                                ^
  3322 |                  "Error: Route "/use-cache-params/[slug]": Uncached data was accessed outside of <Suspense>. This delays the entire page from rendering, resulting in a slow user experience. Learn more: https://nextjs.org/docs/messages/blocking-route
  3323 |                      at a (<next-dist-dir>)
  3324 |                      at b (<next-dist-dir>)

  at Object.toMatchInlineSnapshot (e2e/app-dir/cache-components-errors/cache-components-errors.test.ts:3321:32)

● Cache Components Errors › Build Without --prerender-debug › With use cache: private › in unstable_cache › should error the build

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Cache Components Errors Build Without --prerender-debug With \`use cache: private\` in \`unstable_cache\` should error the build 1`

- Snapshot  - 1
+ Received  + 3

@@ -4,6 +4,8 @@
      at c (<next-dist-dir>)
  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 "/use-cache-private-in-unstable-cache" in your browser to investigate the error.
    - Rerun the production build with `next build --debug-prerender` to generate better stack traces.
  Error occurred prerendering page "/use-cache-private-in-unstable-cache". Read more: https://nextjs.org/docs/messages/prerender-error
- Export encountered an error on /use-cache-private-in-unstable-cache/page: /use-cache-private-in-unstable-cache, exiting the build."
+ Export encountered an error on /use-cache-private-in-unstable-cache/page: /use-cache-private-in-unstable-cache, exiting the build.
+
+ > Build error occurred"

  3620 |                 `)
  3621 |               } else {
> 3622 |                 expect(output).toMatchInlineSnapshot(`
       |                                ^
  3623 |                  "Error: "use cache: private" must not be used within \`unstable_cache()\`.
  3624 |                      at a (<next-dist-dir>)
  3625 |                      at b (<next-dist-dir>)

  at Object.toMatchInlineSnapshot (e2e/app-dir/cache-components-errors/cache-components-errors.test.ts:3622:32)

● Cache Components Errors › Build Without --prerender-debug › With use cache: private › in use cache › should error the build

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Cache Components Errors Build Without --prerender-debug With \`use cache: private\` in \`use cache\` should error the build 1`

- Snapshot  - 1
+ Received  + 3

@@ -10,6 +10,8 @@
  }
  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 "/use-cache-private-in-use-cache" in your browser to investigate the error.
    - Rerun the production build with `next build --debug-prerender` to generate better stack traces.
  Error occurred prerendering page "/use-cache-private-in-use-cache". Read more: https://nextjs.org/docs/messages/prerender-error
- Export encountered an error on /use-cache-private-in-use-cache/page: /use-cache-private-in-use-cache, exiting the build."
+ Export encountered an error on /use-cache-private-in-use-cache/page: /use-cache-private-in-use-cache, exiting the build.
+
+ > Build error occurred"

  3746 |                 `)
  3747 |               } else {
> 3748 |                 expect(output).toMatchInlineSnapshot(`
       |                                ^
  3749 |                  "⨯ Error: "use cache: private" must not be used within "use cache". It can only be nested inside of another "use cache: private".
  3750 |                      at a (<next-dist-dir>)
  3751 |                      at b (<anonymous>) {

  at Object.toMatchInlineSnapshot (e2e/app-dir/cache-components-errors/cache-components-errors.test.ts:3748:32)

● Cache Components Errors › Build Without --prerender-debug › With use cache: private › without Suspense › should error the build

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Cache Components Errors Build Without --prerender-debug With \`use cache: private\` without Suspense should error the build 1`

- Snapshot  - 1
+ Received  + 3

@@ -25,6 +25,8 @@
      at u (<next-dist-dir>)
  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 "/use-cache-private-without-suspense" in your browser to investigate the error.
    - Rerun the production build with `next build --debug-prerender` to generate better stack traces.
  Error occurred prerendering page "/use-cache-private-without-suspense". Read more: https://nextjs.org/docs/messages/prerender-error
- Export encountered an error on /use-cache-private-without-suspense/page: /use-cache-private-without-suspense, exiting the build."
+ Export encountered an error on /use-cache-private-without-suspense/page: /use-cache-private-without-suspense, exiting the build.
+
+ > Build error occurred"

  3859 |                 )
  3860 |               } else {
> 3861 |                 expect(output).toMatchInlineSnapshot(`
       |                                ^
  3862 |                  "Error: Route "/use-cache-private-without-suspense": Uncached data was accessed outside of <Suspense>. This delays the entire page from rendering, resulting in a slow user experience. Learn more: https://nextjs.org/docs/messages/blocking-route
  3863 |                      at a (<next-dist-dir>)
  3864 |                      at b (<next-dist-dir>)

  at Object.toMatchInlineSnapshot (e2e/app-dir/cache-components-errors/cache-components-errors.test.ts:3861:32)

● Cache Components Errors › Build Without --prerender-debug › Sync IO - Current Time - Date() › should error the build if sync IO is used in a Server Component while prerendering

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Cache Components Errors Build Without --prerender-debug Sync IO - Current Time - Date() should error the build if sync IO is used in a Server Component while prerendering 1`

- Snapshot  - 1
+ Received  + 3

@@ -2,6 +2,8 @@
      at a (<next-dist-dir>)
  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-io-current-time/date" in your browser to investigate the error.
    - Rerun the production build with `next build --debug-prerender` to generate better stack traces.
  Error occurred prerendering page "/sync-io-current-time/date". Read more: https://nextjs.org/docs/messages/prerender-error
- Export encountered an error on /sync-io-current-time/date/page: /sync-io-current-time/date, exiting the build."
+ Export encountered an error on /sync-io-current-time/date/page: /sync-io-current-time/date, exiting the build.
+
+ > Build error occurred"

  4034 |               `)
  4035 |             } else {
> 4036 |               expect(output).toMatchInlineSnapshot(`
       |                              ^
  4037 |                "Error: Route "/sync-io-current-time/date" used \`Date()\` before accessing either uncached data (e.g. \`fetch()\`) or Request data (e.g. \`cookies()\`, \`headers()\`, \`connection()\`, and \`searchParams\`). Accessing the current time in a Server Component requires reading one of these data sources first. Alternatively, consider moving this expression into a Client Component or Cache Component. See more info here: https://nextjs.org/docs/messages/next-prerender-current-time
  4038 |                    at a (<next-dist-dir>)
  4039 |                To get a more detailed stack trace and pinpoint the issue, try one of the following:

  at Object.toMatchInlineSnapshot (e2e/app-dir/cache-components-errors/cache-components-errors.test.ts:4036:30)

● Cache Components Errors › Build Without --prerender-debug › Sync IO - Current Time - Date.now() › should error the build if sync IO is used in a Server Component while prerendering

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Cache Components Errors Build Without --prerender-debug Sync IO - Current Time - Date.now() should error the build if sync IO is used in a Server Component while prerendering 1`

- Snapshot  - 1
+ Received  + 3

@@ -2,6 +2,8 @@
      at a (<next-dist-dir>)
  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-io-current-time/date-now" in your browser to investigate the error.
    - Rerun the production build with `next build --debug-prerender` to generate better stack traces.
  Error occurred prerendering page "/sync-io-current-time/date-now". Read more: https://nextjs.org/docs/messages/prerender-error
- Export encountered an error on /sync-io-current-time/date-now/page: /sync-io-current-time/date-now, exiting the build."
+ Export encountered an error on /sync-io-current-time/date-now/page: /sync-io-current-time/date-now, exiting the build.
+
+ > Build error occurred"

  4138 |               `)
  4139 |             } else {
> 4140 |               expect(output).toMatchInlineSnapshot(`
       |                              ^
  4141 |                "Error: Route "/sync-io-current-time/date-now" used \`Date.now()\` before accessing either uncached data (e.g. \`fetch()\`) or Request data (e.g. \`cookies()\`, \`headers()\`, \`connection()\`, and \`searchParams\`). Accessing the current time in a Server Component requires reading one of these data sources first. Alternatively, consider moving this expression into a Client Component or Cache Component. See more info here: https://nextjs.org/docs/messages/next-prerender-current-time
  4142 |                    at a (<next-dist-dir>)
  4143 |                To get a more detailed stack trace and pinpoint the issue, try one of the following:

  at Object.toMatchInlineSnapshot (e2e/app-dir/cache-components-errors/cache-components-errors.test.ts:4140:30)

● Cache Components Errors › Build Without --prerender-debug › Sync IO - Current Time - new Date() › should error the build if sync IO is used in a Server Component while prerendering

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Cache Components Errors Build Without --prerender-debug Sync IO - Current Time - new Date() should error the build if sync IO is used in a Server Component while prerendering 1`

- Snapshot  - 1
+ Received  + 3

@@ -2,6 +2,8 @@
      at a (<next-dist-dir>)
  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-io-current-time/new-date" in your browser to investigate the error.
    - Rerun the production build with `next build --debug-prerender` to generate better stack traces.
  Error occurred prerendering page "/sync-io-current-time/new-date". Read more: https://nextjs.org/docs/messages/prerender-error
- Export encountered an error on /sync-io-current-time/new-date/page: /sync-io-current-time/new-date, exiting the build."
+ Export encountered an error on /sync-io-current-time/new-date/page: /sync-io-current-time/new-date, exiting the build.
+
+ > Build error occurred"

  4242 |               `)
  4243 |             } else {
> 4244 |               expect(output).toMatchInlineSnapshot(`
       |                              ^
  4245 |                "Error: Route "/sync-io-current-time/new-date" used \`new Date()\` before accessing either uncached data (e.g. \`fetch()\`) or Request data (e.g. \`cookies()\`, \`headers()\`, \`connection()\`, and \`searchParams\`). Accessing the current time in a Server Component requires reading one of these data sources first. Alternatively, consider moving this expression into a Client Component or Cache Component. See more info here: https://nextjs.org/docs/messages/next-prerender-current-time
  4246 |                    at a (<next-dist-dir>)
  4247 |                To get a more detailed stack trace and pinpoint the issue, try one of the following:

  at Object.toMatchInlineSnapshot (e2e/app-dir/cache-components-errors/cache-components-errors.test.ts:4244:30)

● Cache Components Errors › Build Without --prerender-debug › Sync IO - Random - Math.random() › should error the build if sync IO is used in a Server Component while prerendering

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Cache Components Errors Build Without --prerender-debug Sync IO - Random - Math.random() should error the build if sync IO is used in a Server Component while prerendering 1`

- Snapshot  - 1
+ Received  + 3

@@ -2,6 +2,8 @@
      at a (<next-dist-dir>)
  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-io-random/math-random" in your browser to investigate the error.
    - Rerun the production build with `next build --debug-prerender` to generate better stack traces.
  Error occurred prerendering page "/sync-io-random/math-random". Read more: https://nextjs.org/docs/messages/prerender-error
- Export encountered an error on /sync-io-random/math-random/page: /sync-io-random/math-random, exiting the build."
+ Export encountered an error on /sync-io-random/math-random/page: /sync-io-random/math-random, exiting the build.
+
+ > Build error occurred"

  4346 |               `)
  4347 |             } else {
> 4348 |               expect(output).toMatchInlineSnapshot(`
       |                              ^
  4349 |                "Error: Route "/sync-io-random/math-random" used \`Math.random()\` before accessing either uncached data (e.g. \`fetch()\`) or Request data (e.g. \`cookies()\`, \`headers()\`, \`connection()\`, and \`searchParams\`). Accessing random values synchronously in a Server Component requires reading one of these data sources first. Alternatively, consider moving this expression into a Client Component or Cache Component. See more info here: https://nextjs.org/docs/messages/next-prerender-random
  4350 |                    at a (<next-dist-dir>)
  4351 |                To get a more detailed stack trace and pinpoint the issue, try one of the following:

  at Object.toMatchInlineSnapshot (e2e/app-dir/cache-components-errors/cache-components-errors.test.ts:4348:30)

● Cache Components Errors › Build Without --prerender-debug › Sync IO - Web Crypto - getRandomValue() › should error the build if sync IO is used in a Server Component while prerendering

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Cache Components Errors Build Without --prerender-debug Sync IO - Web Crypto - getRandomValue() should error the build if sync IO is used in a Server Component while prerendering 1`

- Snapshot  - 1
+ Received  + 3

@@ -2,6 +2,8 @@
      at a (<next-dist-dir>)
  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-io-web-crypto/get-random-value" in your browser to investigate the error.
    - Rerun the production build with `next build --debug-prerender` to generate better stack traces.
  Error occurred prerendering page "/sync-io-web-crypto/get-random-value". Read more: https://nextjs.org/docs/messages/prerender-error
- Export encountered an error on /sync-io-web-crypto/get-random-value/page: /sync-io-web-crypto/get-random-value, exiting the build."
+ Export encountered an error on /sync-io-web-crypto/get-random-value/page: /sync-io-web-crypto/get-random-value, exiting the build.
+
+ > Build error occurred"

  4453 |               `)
  4454 |             } else {
> 4455 |               expect(output).toMatchInlineSnapshot(`
       |                              ^
  4456 |                "Error: Route "/sync-io-web-crypto/get-random-value" used \`crypto.getRandomValues()\` before accessing either uncached data (e.g. \`fetch()\`) or Request data (e.g. \`cookies()\`, \`headers()\`, \`connection()\`, and \`searchParams\`). Accessing random cryptographic values synchronously in a Server Component requires reading one of these data sources first. Alternatively, consider moving this expression into a Client Component or Cache Component. See more info here: https://nextjs.org/docs/messages/next-prerender-crypto
  4457 |                    at a (<next-dist-dir>)
  4458 |                To get a more detailed stack trace and pinpoint the issue, try one of the following:

  at Object.toMatchInlineSnapshot (e2e/app-dir/cache-components-errors/cache-components-errors.test.ts:4455:30)

● Cache Components Errors › Build Without --prerender-debug › Sync IO - Web Crypto - randomUUID() › should error the build if sync IO is used in a Server Component while prerendering

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Cache Components Errors Build Without --prerender-debug Sync IO - Web Crypto - randomUUID() should error the build if sync IO is used in a Server Component while prerendering 1`

- Snapshot  - 1
+ Received  + 3

@@ -2,6 +2,8 @@
      at a (<next-dist-dir>)
  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-io-web-crypto/random-uuid" in your browser to investigate the error.
    - Rerun the production build with `next build --debug-prerender` to generate better stack traces.
  Error occurred prerendering page "/sync-io-web-crypto/random-uuid". Read more: https://nextjs.org/docs/messages/prerender-error
- Export encountered an error on /sync-io-web-crypto/random-uuid/page: /sync-io-web-crypto/random-uuid, exiting the build."
+ Export encountered an error on /sync-io-web-crypto/random-uuid/page: /sync-io-web-crypto/random-uuid, exiting the build.
+
+ > Build error occurred"

  4557 |               `)
  4558 |             } else {
> 4559 |               expect(output).toMatchInlineSnapshot(`
       |                              ^
  4560 |                "Error: Route "/sync-io-web-crypto/random-uuid" used \`crypto.randomUUID()\` before accessing either uncached data (e.g. \`fetch()\`) or Request data (e.g. \`cookies()\`, \`headers()\`, \`connection()\`, and \`searchParams\`). Accessing random cryptographic values synchronously in a Server Component requires reading one of these data sources first. Alternatively, consider moving this expression into a Client Component or Cache Component. See more info here: https://nextjs.org/docs/messages/next-prerender-crypto
  4561 |                    at a (<next-dist-dir>)
  4562 |                To get a more detailed stack trace and pinpoint the issue, try one of the following:

  at Object.toMatchInlineSnapshot (e2e/app-dir/cache-components-errors/cache-components-errors.test.ts:4559:30)

● Cache Components Errors › Build Without --prerender-debug › Sync IO - Node Crypto - generateKeyPairSync() › should error the build if sync IO is used in a Server Component while prerendering

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Cache Components Errors Build Without --prerender-debug Sync IO - Node Crypto - generateKeyPairSync() should error the build if sync IO is used in a Server Component while prerendering 1`

- Snapshot  - 1
+ Received  + 3

@@ -2,6 +2,8 @@
      at a (<next-dist-dir>)
  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-io-node-crypto/generate-key-pair-sync" in your browser to investigate the error.
    - Rerun the production build with `next build --debug-prerender` to generate better stack traces.
  Error occurred prerendering page "/sync-io-node-crypto/generate-key-pair-sync". Read more: https://nextjs.org/docs/messages/prerender-error
- Export encountered an error on /sync-io-node-crypto/generate-key-pair-sync/page: /sync-io-node-crypto/generate-key-pair-sync, exiting the build."
+ Export encountered an error on /sync-io-node-crypto/generate-key-pair-sync/page: /sync-io-node-crypto/generate-key-pair-sync, exiting the build.
+
+ > Build error occurred"

  4681 |               `)
  4682 |             } else {
> 4683 |               expect(output).toMatchInlineSnapshot(`
       |                              ^
  4684 |                "Error: Route "/sync-io-node-crypto/generate-key-pair-sync" used \`require('node:crypto').generateKeyPairSync(...)\` before accessing either uncached data (e.g. \`fetch()\`) or Request data (e.g. \`cookies()\`, \`headers()\`, \`connection()\`, and \`searchParams\`). Accessing random values synchronously in a Server Component requires reading one of these data sources first. Alternatively, consider moving this expression into a Client Component or Cache Component. See more info here: https://nextjs.org/docs/messages/next-prerender-random
  4685 |                    at a (<next-dist-dir>)
  4686 |                To get a more detailed stack trace and pinpoint the issue, try one of the following:

  at Object.toMatchInlineSnapshot (e2e/app-dir/cache-components-errors/cache-components-errors.test.ts:4683:30)

● Cache Components Errors › Build Without --prerender-debug › Sync IO - Node Crypto - generateKeySync() › should error the build if sync IO is used in a Server Component while prerendering

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Cache Components Errors Build Without --prerender-debug Sync IO - Node Crypto - generateKeySync() should error the build if sync IO is used in a Server Component while prerendering 1`

- Snapshot  - 1
+ Received  + 3

@@ -2,6 +2,8 @@
      at a (<next-dist-dir>)
  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-io-node-crypto/generate-key-sync" in your browser to investigate the error.
    - Rerun the production build with `next build --debug-prerender` to generate better stack traces.
  Error occurred prerendering page "/sync-io-node-crypto/generate-key-sync". Read more: https://nextjs.org/docs/messages/prerender-error
- Export encountered an error on /sync-io-node-crypto/generate-key-sync/page: /sync-io-node-crypto/generate-key-sync, exiting the build."
+ Export encountered an error on /sync-io-node-crypto/generate-key-sync/page: /sync-io-node-crypto/generate-key-sync, exiting the build.
+
+ > Build error occurred"

  4805 |               `)
  4806 |             } else {
> 4807 |               expect(output).toMatchInlineSnapshot(`
       |                              ^
  4808 |                "Error: Route "/sync-io-node-crypto/generate-key-sync" used \`require('node:crypto').generateKeySync(...)\` before accessing either uncached data (e.g. \`fetch()\`) or Request data (e.g. \`cookies()\`, \`headers()\`, \`connection()\`, and \`searchParams\`). Accessing random values synchronously in a Server Component requires reading one of these data sources first. Alternatively, consider moving this expression into a Client Component or Cache Component. See more info here: https://nextjs.org/docs/messages/next-prerender-random
  4809 |                    at a (<next-dist-dir>)
  4810 |                To get a more detailed stack trace and pinpoint the issue, try one of the following:

  at Object.toMatchInlineSnapshot (e2e/app-dir/cache-components-errors/cache-components-errors.test.ts:4807:30)

● Cache Components Errors › Build Without --prerender-debug › Sync IO - Node Crypto - generatePrimeSync() › should error the build if sync IO is used in a Server Component while prerendering

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Cache Components Errors Build Without --prerender-debug Sync IO - Node Crypto - generatePrimeSync() should error the build if sync IO is used in a Server Component while prerendering 1`

- Snapshot  - 1
+ Received  + 3

@@ -2,6 +2,8 @@
      at a (<next-dist-dir>)
  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-io-node-crypto/generate-prime-sync" in your browser to investigate the error.
    - Rerun the production build with `next build --debug-prerender` to generate better stack traces.
  Error occurred prerendering page "/sync-io-node-crypto/generate-prime-sync". Read more: https://nextjs.org/docs/messages/prerender-error
- Export encountered an error on /sync-io-node-crypto/generate-prime-sync/page: /sync-io-node-crypto/generate-prime-sync, exiting the build."
+ Export encountered an error on /sync-io-node-crypto/generate-prime-sync/page: /sync-io-node-crypto/generate-prime-sync, exiting the build.
+
+ > Build error occurred"

  4929 |               `)
  4930 |             } else {
> 4931 |               expect(output).toMatchInlineSnapshot(`
       |                              ^
  4932 |                "Error: Route "/sync-io-node-crypto/generate-prime-sync" used \`require('node:crypto').generatePrimeSync(...)\` before accessing either uncached data (e.g. \`fetch()\`) or Request data (e.g. \`cookies()\`, \`headers()\`, \`connection()\`, and \`searchParams\`). Accessing random values synchronously in a Server Component requires reading one of these data sources first. Alternatively, consider moving this expression into a Client Component or Cache Component. See more info here: https://nextjs.org/docs/messages/next-prerender-random
  4933 |                    at a (<next-dist-dir>)
  4934 |                To get a more detailed stack trace and pinpoint the issue, try one of the following:

  at Object.toMatchInlineSnapshot (e2e/app-dir/cache-components-errors/cache-components-errors.test.ts:4931:30)

● Cache Components Errors › Build Without --prerender-debug › Sync IO - Node Crypto - getRandomValues() › should error the build if sync IO is used in a Server Component while prerendering

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Cache Components Errors Build Without --prerender-debug Sync IO - Node Crypto - getRandomValues() should error the build if sync IO is used in a Server Component while prerendering 1`

- Snapshot  - 1
+ Received  + 3

@@ -2,6 +2,8 @@
      at a (<next-dist-dir>)
  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-io-node-crypto/get-random-values" in your browser to investigate the error.
    - Rerun the production build with `next build --debug-prerender` to generate better stack traces.
  Error occurred prerendering page "/sync-io-node-crypto/get-random-values". Read more: https://nextjs.org/docs/messages/prerender-error
- Export encountered an error on /sync-io-node-crypto/get-random-values/page: /sync-io-node-crypto/get-random-values, exiting the build."
+ Export encountered an error on /sync-io-node-crypto/get-random-values/page: /sync-io-node-crypto/get-random-values, exiting the build.
+
+ > Build error occurred"

  5053 |               `)
  5054 |             } else {
> 5055 |               expect(output).toMatchInlineSnapshot(`
       |                              ^
  5056 |                "Error: Route "/sync-io-node-crypto/get-random-values" used \`crypto.getRandomValues()\` before accessing either uncached data (e.g. \`fetch()\`) or Request data (e.g. \`cookies()\`, \`headers()\`, \`connection()\`, and \`searchParams\`). Accessing random cryptographic values synchronously in a Server Component requires reading one of these data sources first. Alternatively, consider moving this expression into a Client Component or Cache Component. See more info here: https://nextjs.org/docs/messages/next-prerender-crypto
  5057 |                    at a (<next-dist-dir>)
  5058 |                To get a more detailed stack trace and pinpoint the issue, try one of the following:

  at Object.toMatchInlineSnapshot (e2e/app-dir/cache-components-errors/cache-components-errors.test.ts:5055:30)

● Cache Components Errors › Build Without --prerender-debug › Sync IO - Node Crypto - random-bytes() › should error the build if sync IO is used in a Server Component while prerendering

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Cache Components Errors Build Without --prerender-debug Sync IO - Node Crypto - random-bytes() should error the build if sync IO is used in a Server Component while prerendering 1`

- Snapshot  - 1
+ Received  + 3

@@ -2,6 +2,8 @@
      at a (<next-dist-dir>)
  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-io-node-crypto/random-bytes" in your browser to investigate the error.
    - Rerun the production build with `next build --debug-prerender` to generate better stack traces.
  Error occurred prerendering page "/sync-io-node-crypto/random-bytes". Read more: https://nextjs.org/docs/messages/prerender-error
- Export encountered an error on /sync-io-node-crypto/random-bytes/page: /sync-io-node-crypto/random-bytes, exiting the build."
+ Export encountered an error on /sync-io-node-crypto/random-bytes/page: /sync-io-node-crypto/random-bytes, exiting the build.
+
+ > Build error occurred"

  5177 |               `)
  5178 |             } else {
> 5179 |               expect(output).toMatchInlineSnapshot(`
       |                              ^
  5180 |                "Error: Route "/sync-io-node-crypto/random-bytes" used \`require('node:crypto').randomBytes(size)\` before accessing either uncached data (e.g. \`fetch()\`) or Request data (e.g. \`cookies()\`, \`headers()\`, \`connection()\`, and \`searchParams\`). Accessing random values synchronously in a Server Component requires reading one of these data sources first. Alternatively, consider moving this expression into a Client Component or Cache Component. See more info here: https://nextjs.org/docs/messages/next-prerender-random
  5181 |                    at a (<next-dist-dir>)
  5182 |                To get a more detailed stack trace and pinpoint the issue, try one of the following:

  at Object.toMatchInlineSnapshot (e2e/app-dir/cache-components-errors/cache-components-errors.test.ts:5179:30)

● Cache Components Errors › Build Without --prerender-debug › Sync IO - Node Crypto - random-fill-sync() › should error the build if sync IO is used in a Server Component while prerendering

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Cache Components Errors Build Without --prerender-debug Sync IO - Node Crypto - random-fill-sync() should error the build if sync IO is used in a Server Component while prerendering 1`

- Snapshot  - 1
+ Received  + 3

@@ -2,6 +2,8 @@
      at a (<next-dist-dir>)
  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-io-node-crypto/random-fill-sync" in your browser to investigate the error.
    - Rerun the production build with `next build --debug-prerender` to generate better stack traces.
  Error occurred prerendering page "/sync-io-node-crypto/random-fill-sync". Read more: https://nextjs.org/docs/messages/prerender-error
- Export encountered an error on /sync-io-node-crypto/random-fill-sync/page: /sync-io-node-crypto/random-fill-sync, exiting the build."
+ Export encountered an error on /sync-io-node-crypto/random-fill-sync/page: /sync-io-node-crypto/random-fill-sync, exiting the build.
+
+ > Build error occurred"

  5301 |               `)
  5302 |             } else {
> 5303 |               expect(output).toMatchInlineSnapshot(`
       |                              ^
  5304 |                "Error: Route "/sync-io-node-crypto/random-fill-sync" used \`require('node:crypto').randomFillSync(...)\` before accessing either uncached data (e.g. \`fetch()\`) or Request data (e.g. \`cookies()\`, \`headers()\`, \`connection()\`, and \`searchParams\`). Accessing random values synchronously in a Server Component requires reading one of these data sources first. Alternatively, consider moving this expression into a Client Component or Cache Component. See more info here: https://nextjs.org/docs/messages/next-prerender-random
  5305 |                    at a (<next-dist-dir>)
  5306 |                To get a more detailed stack trace and pinpoint the issue, try one of the following:

  at Object.toMatchInlineSnapshot (e2e/app-dir/cache-components-errors/cache-components-errors.test.ts:5303:30)

● Cache Components Errors › Build Without --prerender-debug › Sync IO - Node Crypto - random-int-between() › should error the build if sync IO is used in a Server Component while prerendering

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Cache Components Errors Build Without --prerender-debug Sync IO - Node Crypto - random-int-between() should error the build if sync IO is used in a Server Component while prerendering 1`

- Snapshot  - 1
+ Received  + 3

@@ -2,6 +2,8 @@
      at a (<next-dist-dir>)
  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-io-node-crypto/random-int-between" in your browser to investigate the error.
    - Rerun the production build with `next build --debug-prerender` to generate better stack traces.
  Error occurred prerendering page "/sync-io-node-crypto/random-int-between". Read more: https://nextjs.org/docs/messages/prerender-error
- Export encountered an error on /sync-io-node-crypto/random-int-between/page: /sync-io-node-crypto/random-int-between, exiting the build."
+ Export encountered an error on /sync-io-node-crypto/random-int-between/page: /sync-io-node-crypto/random-int-between, exiting the build.
+
+ > Build error occurred"

  5425 |               `)
  5426 |             } else {
> 5427 |               expect(output).toMatchInlineSnapshot(`
       |                              ^
  5428 |                "Error: Route "/sync-io-node-crypto/random-int-between" used \`require('node:crypto').randomInt(min, max)\` before accessing either uncached data (e.g. \`fetch()\`) or Request data (e.g. \`cookies()\`, \`headers()\`, \`connection()\`, and \`searchParams\`). Accessing random values synchronously in a Server Component requires reading one of these data sources first. Alternatively, consider moving this expression into a Client Component or Cache Component. See more info here: https://nextjs.org/docs/messages/next-prerender-random
  5429 |                    at a (<next-dist-dir>)
  5430 |                To get a more detailed stack trace and pinpoint the issue, try one of the following:

  at Object.toMatchInlineSnapshot (e2e/app-dir/cache-components-errors/cache-components-errors.test.ts:5427:30)

● Cache Components Errors › Build Without --prerender-debug › Sync IO - Node Crypto - random-int-up-to() › should error the build if sync IO is used in a Server Component while prerendering

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Cache Components Errors Build Without --prerender-debug Sync IO - Node Crypto - random-int-up-to() should error the build if sync IO is used in a Server Component while prerendering 1`

- Snapshot  - 1
+ Received  + 3

@@ -2,6 +2,8 @@
      at a (<next-dist-dir>)
  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-io-node-crypto/random-int-up-to" in your browser to investigate the error.
    - Rerun the production build with `next build --debug-prerender` to generate better stack traces.
  Error occurred prerendering page "/sync-io-node-crypto/random-int-up-to". Read more: https://nextjs.org/docs/messages/prerender-error
- Export encountered an error on /sync-io-node-crypto/random-int-up-to/page: /sync-io-node-crypto/random-int-up-to, exiting the build."
+ Export encountered an error on /sync-io-node-crypto/random-int-up-to/page: /sync-io-node-crypto/random-int-up-to, exiting the build.
+
+ > Build error occurred"

  5549 |               `)
  5550 |             } else {
> 5551 |               expect(output).toMatchInlineSnapshot(`
       |                              ^
  5552 |                "Error: Route "/sync-io-node-crypto/random-int-up-to" used \`require('node:crypto').randomInt(min, max)\` before accessing either uncached data (e.g. \`fetch()\`) or Request data (e.g. \`cookies()\`, \`headers()\`, \`connection()\`, and \`searchParams\`). Accessing random values synchronously in a Server Component requires reading one of these data sources first. Alternatively, consider moving this expression into a Client Component or Cache Component. See more info here: https://nextjs.org/docs/messages/next-prerender-random
  5553 |                    at a (<next-dist-dir>)
  5554 |                To get a more detailed stack trace and pinpoint the issue, try one of the following:

  at Object.toMatchInlineSnapshot (e2e/app-dir/cache-components-errors/cache-components-errors.test.ts:5551:30)

● Cache Components Errors › Build Without --prerender-debug › Sync IO - Node Crypto - random-uuid › should error the build if sync IO is used in a Server Component while prerendering

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Cache Components Errors Build Without --prerender-debug Sync IO - Node Crypto - random-uuid should error the build if sync IO is used in a Server Component while prerendering 1`

- Snapshot  - 1
+ Received  + 3

@@ -2,6 +2,8 @@
      at a (<next-dist-dir>)
  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-io-node-crypto/random-uuid" in your browser to investigate the error.
    - Rerun the production build with `next build --debug-prerender` to generate better stack traces.
  Error occurred prerendering page "/sync-io-node-crypto/random-uuid". Read more: https://nextjs.org/docs/messages/prerender-error
- Export encountered an error on /sync-io-node-crypto/random-uuid/page: /sync-io-node-crypto/random-uuid, exiting the build."
+ Export encountered an error on /sync-io-node-crypto/random-uuid/page: /sync-io-node-crypto/random-uuid, exiting the build.
+
+ > Build error occurred"

  5673 |               `)
  5674 |             } else {
> 5675 |               expect(output).toMatchInlineSnapshot(`
       |                              ^
  5676 |                "Error: Route "/sync-io-node-crypto/random-uuid" used \`require('node:crypto').randomUUID()\` before accessing either uncached data (e.g. \`fetch()\`) or Request data (e.g. \`cookies()\`, \`headers()\`, \`connection()\`, and \`searchParams\`). Accessing random values synchronously in a Server Component requires reading one of these data sources first. Alternatively, consider moving this expression into a Client Component or Cache Component. See more info here: https://nextjs.org/docs/messages/next-prerender-random
  5677 |                    at a (<next-dist-dir>)
  5678 |                To get a more detailed stack trace and pinpoint the issue, try one of the following:

  at Object.toMatchInlineSnapshot (e2e/app-dir/cache-components-errors/cache-components-errors.test.ts:5675:30)

● Cache Components Errors › Build Without --prerender-debug › IO accessed in Client Components › should error the build if IO is accessed in a Client Component

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Cache Components Errors Build Without --prerender-debug IO accessed in Client Components should error the build if IO is accessed in a Client Component 1`

- Snapshot  - 1
+ Received  + 3

@@ -25,6 +25,8 @@
      at v (<next-dist-dir>)
  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-awaited-io" in your browser to investigate the error.
    - Rerun the production build with `next build --debug-prerender` to generate better stack traces.
  Error occurred prerendering page "/client-awaited-io". Read more: https://nextjs.org/docs/messages/prerender-error
- Export encountered an error on /client-awaited-io/page: /client-awaited-io, exiting the build."
+ Export encountered an error on /client-awaited-io/page: /client-awaited-io, exiting the build.
+
+ > Build error occurred"

  5794 |               `)
  5795 |             } else {
> 5796 |               expect(output).toMatchInlineSnapshot(`
       |                              ^
  5797 |                "Error: Route "/client-awaited-io": Uncached data was accessed outside of <Suspense>. This delays the entire page from rendering, resulting in a slow user experience. Learn more: https://nextjs.org/docs/messages/blocking-route
  5798 |                    at a (<next-dist-dir>)
  5799 |                    at b (<next-dist-dir>)

  at Object.toMatchInlineSnapshot (e2e/app-dir/cache-components-errors/cache-components-errors.test.ts:5796:30)

@nextjs-bot
Copy link
Collaborator

nextjs-bot commented Feb 25, 2026

Stats from current PR

🔴 1 regression

Metric Canary PR Change Trend
node_modules Size 475 MB 475 MB 🔴 +292 kB (+0%) ▁▁▁▁▁
📊 All Metrics
📖 Metrics Glossary

Dev Server Metrics:

  • Listen = TCP port starts accepting connections
  • First Request = HTTP server returns successful response
  • Cold = Fresh build (no cache)
  • Warm = With cached build artifacts

Build Metrics:

  • Fresh = Clean build (no .next directory)
  • Cached = With existing .next directory

Change Thresholds:

  • Time: Changes < 50ms AND < 10%, OR < 2% are insignificant
  • Size: Changes < 1KB AND < 1% are insignificant
  • All other changes are flagged to catch regressions

⚡ Dev Server

Metric Canary PR Change Trend
Cold (Listen) 455ms 455ms █▁▁▁▁
Cold (Ready in log) 438ms 440ms █▂▂▁▂
Cold (First Request) 1.246s 1.237s █▄▄▄▄
Warm (Listen) 457ms 456ms █▁▁▁▁
Warm (Ready in log) 442ms 442ms █▁▁▁▁
Warm (First Request) 346ms 349ms █▂▁▁▁
📦 Dev Server (Webpack) (Legacy)

📦 Dev Server (Webpack)

Metric Canary PR Change Trend
Cold (Listen) 455ms 455ms ▅▁▅▁▅
Cold (Ready in log) 435ms 436ms ▆▅▆▂▆
Cold (First Request) 1.933s 1.930s █▄▅▁▆
Warm (Listen) 456ms 455ms ▃▁▃▃▆
Warm (Ready in log) 436ms 435ms ▇▅▆▁█
Warm (First Request) 1.959s 1.951s █▄▄▁▅

⚡ Production Builds

Metric Canary PR Change Trend
Fresh Build 4.032s 3.948s █▁▁▁▁
Cached Build 4.035s 3.931s █▁▁▁▁
📦 Production Builds (Webpack) (Legacy)

📦 Production Builds (Webpack)

Metric Canary PR Change Trend
Fresh Build 13.910s 13.963s █▂▂▁▄
Cached Build 14.041s 14.109s █▂▂▁▃
node_modules Size 475 MB 475 MB 🔴 +292 kB (+0%) ▁▁▁▁▁
📦 Bundle Sizes

Bundle Sizes

⚡ Turbopack

Client

Main Bundles: **400 kB** → **400 kB** ✅ -13 B

80 files with content-based hashes (individual files not comparable between builds)

Server

Middleware
Canary PR Change
middleware-b..fest.js gzip 764 B 764 B
Total 764 B 764 B
Build Details
Build Manifests
Canary PR Change
_buildManifest.js gzip 451 B 452 B
Total 451 B 452 B ⚠️ +1 B

📦 Webpack

Client

Main Bundles
Canary PR Change
5528-HASH.js gzip 5.54 kB N/A -
6280-HASH.js gzip 58.3 kB N/A -
6335.HASH.js gzip 169 B N/A -
912-HASH.js gzip 4.59 kB N/A -
e8aec2e4-HASH.js gzip 62.6 kB N/A -
framework-HASH.js gzip 59.7 kB 59.7 kB
main-app-HASH.js gzip 256 B 254 B
main-HASH.js gzip 39.1 kB 39.1 kB
webpack-HASH.js gzip 1.68 kB 1.68 kB
262-HASH.js gzip N/A 4.59 kB -
2889.HASH.js gzip N/A 169 B -
5602-HASH.js gzip N/A 5.55 kB -
6948ada0-HASH.js gzip N/A 62.6 kB -
9544-HASH.js gzip N/A 59 kB -
Total 232 kB 233 kB ⚠️ +719 B
Polyfills
Canary PR Change
polyfills-HASH.js gzip 39.4 kB 39.4 kB
Total 39.4 kB 39.4 kB
Pages
Canary PR Change
_app-HASH.js gzip 194 B 194 B
_error-HASH.js gzip 183 B 180 B 🟢 3 B (-2%)
css-HASH.js gzip 331 B 330 B
dynamic-HASH.js gzip 1.81 kB 1.81 kB
edge-ssr-HASH.js gzip 256 B 256 B
head-HASH.js gzip 351 B 352 B
hooks-HASH.js gzip 384 B 383 B
image-HASH.js gzip 580 B 581 B
index-HASH.js gzip 260 B 260 B
link-HASH.js gzip 2.5 kB 2.5 kB
routerDirect..HASH.js gzip 320 B 319 B
script-HASH.js gzip 386 B 386 B
withRouter-HASH.js gzip 315 B 315 B
1afbb74e6ecf..834.css gzip 106 B 106 B
Total 7.97 kB 7.97 kB ✅ -2 B

Server

Edge SSR
Canary PR Change
edge-ssr.js gzip 125 kB 125 kB
page.js gzip 254 kB 254 kB
Total 379 kB 379 kB ⚠️ +315 B
Middleware
Canary PR Change
middleware-b..fest.js gzip 617 B 612 B
middleware-r..fest.js gzip 156 B 155 B
middleware.js gzip 43.8 kB 44 kB
edge-runtime..pack.js gzip 842 B 842 B
Total 45.4 kB 45.6 kB ⚠️ +189 B
Build Details
Build Manifests
Canary PR Change
_buildManifest.js gzip 715 B 718 B
Total 715 B 718 B ⚠️ +3 B
Build Cache
Canary PR Change
0.pack gzip 4.01 MB 4.03 MB 🔴 +13.3 kB (+0%)
index.pack gzip 103 kB 103 kB
index.pack.old gzip 102 kB 103 kB 🔴 +1.07 kB (+1%)
Total 4.22 MB 4.23 MB ⚠️ +14.7 kB

🔄 Shared (bundler-independent)

Runtimes
Canary PR Change
app-page-exp...dev.js gzip 320 kB 320 kB
app-page-exp..prod.js gzip 170 kB 170 kB
app-page-tur...dev.js gzip 319 kB 319 kB
app-page-tur..prod.js gzip 169 kB 169 kB
app-page-tur...dev.js gzip 316 kB 316 kB
app-page-tur..prod.js gzip 168 kB 168 kB
app-page.run...dev.js gzip 316 kB 316 kB
app-page.run..prod.js gzip 168 kB 168 kB
app-route-ex...dev.js gzip 70.8 kB 70.8 kB
app-route-ex..prod.js gzip 49.2 kB 49.2 kB
app-route-tu...dev.js gzip 70.8 kB 70.8 kB
app-route-tu..prod.js gzip 49.2 kB 49.2 kB
app-route-tu...dev.js gzip 70.4 kB 70.4 kB
app-route-tu..prod.js gzip 49 kB 49 kB
app-route.ru...dev.js gzip 70.4 kB 70.4 kB
app-route.ru..prod.js gzip 49 kB 49 kB
dist_client_...dev.js gzip 324 B 324 B
dist_client_...dev.js gzip 326 B 326 B
dist_client_...dev.js gzip 318 B 318 B
dist_client_...dev.js gzip 317 B 317 B
pages-api-tu...dev.js gzip 43.2 kB 43.2 kB
pages-api-tu..prod.js gzip 32.9 kB 32.9 kB
pages-api.ru...dev.js gzip 43.2 kB 43.2 kB
pages-api.ru..prod.js gzip 32.8 kB 32.8 kB
pages-turbo....dev.js gzip 52.5 kB 52.5 kB
pages-turbo...prod.js gzip 38.5 kB 38.5 kB
pages.runtim...dev.js gzip 52.5 kB 52.5 kB
pages.runtim..prod.js gzip 38.4 kB 38.4 kB
server.runti..prod.js gzip 62 kB 62 kB
Total 2.82 MB 2.82 MB ✅ -1 B
📎 Tarball URL
next@https://vercel-packages.vercel.app/next/prs/90532/next

Removes the jest-worker dependency and implements a custom worker pool
under packages/next/src/lib/worker/ with lazy spawning, dynamic scaling,
per-worker concurrency via request ID correlation, and individual worker
restart support.

Key changes:
- New WorkerPool class that spawns workers on-demand as jobs arrive
- Custom child process and worker thread handlers with request IDs
  for concurrent call multiplexing
- Worker class refactored to use WorkerPool instead of JestWorker
- Dev server updated to use the Worker wrapper instead of direct
  jest-worker import
- Build trace paths updated for new worker child file locations
Add WorkerPool unit tests (worker-pool.test.ts) covering:
- Lazy spawning (no workers on construction, spawn on dispatch)
- Dynamic scaling (0 to maxWorkers as jobs arrive)
- Task queuing and FIFO dequeuing
- Concurrency per worker (multiple in-flight calls)
- Message handling (OK, CLIENT_ERROR, SETUP_ERROR, CUSTOM)
- end() and close() lifecycle
- Unexpected worker exit handling
- stdout/stderr piping
- Fork options (env, execArgv, JEST_WORKER_ID)

Extend Worker wrapper tests (worker.test.ts) covering:
- Color propagation edge cases (CI, TERM=dumb, stderr-only TTY)
- Option forwarding (concurrencyPerWorker, enableWorkerThreads, maxRetries)
- Exposed method behavior (underscore filtering, arg sanitization)
- end()/close() lifecycle (idempotency, double-call errors)
- Env configuration (IS_NEXT_WORKER, isolatedMemory, enableSourceMaps)
- Timeout and activity callbacks
- Custom message handling
- Remove stale jest-worker ignore pattern from collect-build-traces.ts
- Remove compiled jest-worker directory and type declarations
- Consolidate instanceof checks into WorkerHandle abstraction class
- Remove dead restartWorker public method
- Fix respawnCount reset bug: preserve count across respawns via
  existingRespawnCount parameter
- Fix process.on('exit') listener leak: store handler reference,
  remove in end()/close()
- Add error event handler on child processes to prevent unhandled
  'error' events (ENOMEM, EMFILE)
- Extract shared child protocol logic into worker-child-common.ts
  (ChildTransport interface + createMessageHandler factory)
- Fix maxRetries reference bug in WorkerPool constructor (was
  referencing non-existent options.maxRetries instead of maxRespawns)
- Update README with architecture changes and option renames
- Add comprehensive tests: end() in-flight rejection, spawn errors,
  respawn count preservation, exit handler cleanup
Limits how many workers can be in the "booting" state simultaneously,
preventing resource contention when many tasks arrive at once. Workers
send a PARENT_MESSAGE_READY after loading their module and running
setup(), transitioning from booting to ready. When the booting limit
is reached, tasks queue instead of spawning new workers. When a worker
becomes ready, queued tasks trigger additional spawns as needed.

Default: Math.ceil(maxWorkers / 4)
- Fix constructor defaults: spread options first, then apply fallbacks,
  so explicit undefined doesn't clobber computed defaults
- Clear booting state on SETUP_ERROR so the booting slot is freed
- Validate maxBootingWorkers >= 1 to prevent silent pool deadlock
- Remove stale 'Call retries were exceeded' catch guard from type-check
  (was a jest-worker message, never produced by the new pool)
- Remove unused errors.json entry 1083
- Fix constructor defaults: spread options first, then apply fallbacks,
  so explicit undefined doesn't clobber computed defaults
- Clear booting state on SETUP_ERROR so the booting slot is freed
- Validate maxBootingWorkers >= 1 to prevent silent pool deadlock
- Remove stale 'Call retries were exceeded' catch guard from type-check
  (was a jest-worker message, never produced by the new pool)
- Remove unused errors.json entry 1083
Add missing documentation for pool/worker methods, callbacks
(onWorkerExit, onCustomMessage), all Worker options (logger,
maxRetries mapping, forkOptions.execArgv), shutdown semantics
(500ms force-kill timeout, close vs end), setup/teardown contract
details (sync or async, setupArgs), and process exit handler
cleanup behavior.
Add entries 1083-1085 generated during build:
- 1083: maxBootingWorkers must be at least 1
- 1084: Worker exited during shutdown
- 1085: Worker pool ended while requests were in-flight
- Reword "crash/crashes" in worker README to avoid alex profanity lint
- Add tsec ban-eval-calls exemption for worker-child-common.ts
- Add 6 new dist/lib/worker/*.js files to NFT snapshot
- Update CPU profiling test to expect build-static-worker profile
@sokra sokra force-pushed the sokra/static-worker-count branch from 63886a8 to f3097b5 Compare February 26, 2026 06:14
Remove maxRespawns from WorkerPool — the pool already spawns new
workers on demand when dispatch() is called, so explicit respawning
is unnecessary. Instead, implement retry logic in the Worker class:
when a dispatch fails with WorkerExitError (worker crash), re-dispatch
the same call up to maxRetries times.

- Add WorkerExitError class to distinguish crashes from method errors
- Remove maxRespawns, respawnCount, and respawn branch from pool
- Add dispatchWithRetry() in Worker with onRestart callback support
- Remove onWorkerExit → process.exit() handler from Worker
This env var was inherited from jest-worker and serves no purpose
in Next.js's own worker pool implementation.
…mments

- WorkerHandle: replace _isThread boolean + type casts with typed nullable
  fields (_thread/_process), eliminating all `as` casts
- Extract _canSpawnWorker() helper to deduplicate the spawn-eligibility
  check used in dispatch(), _handleExit(), and _spawnForQueuedTasks()
- Simplify _deserializeError() using destructuring and Object.assign
- Extract buildWorkerEnv() from the Worker constructor to isolate
  NODE_OPTIONS, debug port, source maps, and color detection logic
- Add comment explaining the +1 debug port offset
- Extract normalizeError() in worker-child-common.ts to deduplicate
  error serialization in reportClientError/reportInitializeError
- Add comments explaining why eval('require') is used
- Rename legacy "Farm" error message to "Worker"
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| `exposedMethods` | string[] | required | Methods to wire up from worker module (underscore-prefixed names are skipped) |
| `debuggerPortOffset` | number | required | Debugger port offset (`-1` = not inspectable) |
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better use number | undefined, default to undefined and undefined = not inspectable

|--------|------|---------|-------------|
| `exposedMethods` | string[] | required | Methods to wire up from worker module (underscore-prefixed names are skipped) |
| `debuggerPortOffset` | number | required | Debugger port offset (`-1` = not inspectable) |
| `isolatedMemory` | boolean | required | If true, strips `--max-old-space-size` from NODE_OPTIONS |
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

default to false

| `exposedMethods` | string[] | required | Methods to wire up from worker module (underscore-prefixed names are skipped) |
| `debuggerPortOffset` | number | required | Debugger port offset (`-1` = not inspectable) |
| `isolatedMemory` | boolean | required | If true, strips `--max-old-space-size` from NODE_OPTIONS |
| `numWorkers` | number | 1 | Maps to `maxWorkers` |
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Default to the number of CPUs - 1, minimum 1

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename to maxWorkers

Comment on lines 122 to 125
// eval('require') prevents the bundler from statically tracing this
// require(). The module path is provided at runtime via the INITIALIZE
// message, so static analysis would fail or produce incorrect bundles.
// eslint-disable-next-line no-eval
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not needed as this code isn't bundled.

Comment on lines 155 to 157
// For dev server, it's not necessary to spin up too many workers as long as you are not doing a load test.
// This helps reusing the memory a lot.
numWorkers: 1,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add concurrency per worker of 4

…'require')

- Add workerName option to Worker class for user-friendly error messages
  (e.g. "Next.js build worker exited with code: X and signal: Y")
- Change debuggerPortOffset from required number to optional (default undefined)
- Change isolatedMemory from required boolean to optional (default false)
- Rename numWorkers to maxWorkers, default to os.cpus().length - 1
- Remove eval('require') wrapper in worker-child-common.ts (not bundled)
- Add concurrencyPerWorker: 4 to dev server worker
- Update all callers and tests
- Static generation worker: "Next.js static worker"
- Turbopack build worker: "Next.js turbopack build worker"
- Webpack build worker: "Next.js webpack worker ({compilerName})"
- Build trace worker: "Next.js build trace worker"
- Type check worker: "Next.js type check worker"
- Static paths worker (dev): "Next.js static paths worker"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants