Error: An error occurred in the Server Components render. The specific message is omitted in production builds to avoid leaking sensitive details. A digest property is included on this error instance which may provide additional details about the nature of the error.

Next.js · updated 2026-11-05

Seen in the browser console and in error.tsx boundaries of a production App Router build. React swaps the server-side message for this generic text plus a digest hash (Next.js 16 builds show Minified React error #441, which links to the same text); the original error and stack are printed only in the server's own output.

Error: An error occurred in the Server Components render. The specific message is omitted in production builds to avoid leaking sensitive details. A digest property is included on this error instance which may provide additional details about the nature of the error.
    at sk (https://example.com/_next/static/chunks/4bd1b696-a1b2c3d4e5f6a7b8.js:1:110223)
    at nU (https://example.com/_next/static/chunks/4bd1b696-a1b2c3d4e5f6a7b8.js:1:121101)
  digest: '2810573849'

Server output from next start for the same request:
 ⨯ Error: connect ECONNREFUSED 10.0.3.12:5432
    at async getProjects (.next/server/app/dashboard/page.js:1:4021) {
  digest: '2810573849'
}

Quick fix

Copy the digest from the browser error and search your server logs for it: next start prints the original error with the same digest. To stop hunting through logs, export onRequestError from instrumentation.ts and send every server render, route handler and server action error, with its digest and route, to an error tracker.

  1. Copy the digest (error.digest in error.tsx, or from the browser console).
  2. Search server output for it: pm2 logs, docker logs, or your host's function logs.
  3. Read the original message and stack printed next to that digest.
  4. Reproduce locally with next build and next start if dev mode doesn't show it.
  5. Export onRequestError from instrumentation.ts to report server errors with route context.
  6. Render error.digest in error.tsx so users can quote it to support.
typescript
// instrumentation.ts (project root, or src/ if you use it)
import type { Instrumentation } from 'next';

export const onRequestError: Instrumentation.onRequestError = async (err, request, context) => {
  const e = err as Error & { digest?: string };
  // Replace console.error with your error tracker's capture call
  console.error('[server error]', {
    digest: e.digest,
    message: e.message,
    stack: e.stack,
    path: request.path,
    route: context.routePath,
    kind: context.routeType, // 'render' | 'route' | 'action' | 'proxy'
  });
};
Fix it with your coding agent

Paste this into Claude Code, Cursor or Codex in the project that throws it. The agent reads this guide in plain text and applies the fix that matches your stack.

prompttext
Read https://runheed.com/errors/server-components-render-error.md and fix this error in this project.

Why it happens

A data call failed during render

A database query, an internal API fetch or an SDK call threw inside an async Server Component: bad credentials, a timeout, a row the code assumed existed. The real message stays on the server while the browser gets the generic one.

Environment variable missing at runtime

Values present in development or at build time are absent from the production runtime, so a client constructor throws on the first request. NEXT_PUBLIC_ variables are inlined at build, while server-only variables are read when the code runs.

Props that cannot cross to a Client Component

Passing class instances, functions other than server actions, or other non-serializable values from a Server Component to a Client Component fails. Development names the offending prop; production shows only this message.

Browser APIs used on the server

Code that touches window, document or localStorage runs in a Server Component and throws a ReferenceError there. In a client component the same error stays in the server log and the browser renders that part itself, so this message does not appear.

Errors thrown from server actions

Exceptions inside a server action reach the client with the same sanitized message. Expected failures such as validation or permission problems should be returned as values so the UI can show them.

Other fixes

  • Add error.tsx boundaries per route segment so one failing component does not take down the whole page.
  • Return expected failures from server actions as data ({ ok: false, message }) instead of throwing.
  • Validate required environment variables at startup so a missing secret fails the deploy, not the first request.
  • Move browser API access into useEffect, or load that component with next/dynamic and ssr: false.

Same error, other wording

  • Application error: a server-side exception has occurred (see the server logs for more information). Digest: 2810573849
  • Error: An error occurred in the Server Components render.
  • Minified React error #441; visit https://react.dev/errors/441 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
  • Application error: a server-side exception has occurred while loading example.com (see the server logs for more information). Digest: 2810573849

Let your coding agent catch the next one

Runheed records this error in production with the stack trace, the breadcrumbs before it and, when you set it, the agent session that shipped the code, and serves it to Claude Code, Cursor or any MCP client. With it connected, you can ask:

> Find the production errors reported from onRequestError in our Next.js app, tell me which route and data call threw, and fix the most frequent one.

Setup for Next.js or Vercel Functions, then have your agent fix and resolve it.

Related errors

More in React and Next.js rendering

Other error topics

Free tools: Source map stack trace decoder · Uptime and SLA downtime calculator · Error budget calculator · Stack trace formatter · JSON log viewer · HTTP status code reference.

References: Next.js: instrumentation.js (onRequestError), Next.js: error.js file convention, Next.js: Error handling

Spotted a mistake? Email hello@greatwork.company. About Runheed.