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.
- Copy the digest (error.digest in error.tsx, or from the browser console).
- Search server output for it: pm2 logs, docker logs, or your host's function logs.
- Read the original message and stack printed next to that digest.
- Reproduce locally with next build and next start if dev mode doesn't show it.
- Export onRequestError from instrumentation.ts to report server errors with route context.
- Render error.digest in error.tsx so users can quote it to support.
// 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'
});
};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.
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
- Hydration failed because the server rendered HTML didn't match the client. As a result...
- Dynamic server usage: Route /x couldn't be rendered statically because it used `headers`.
- Module not found: Can't resolve 'fs'
More in React and Next.js rendering
- ResizeObserver loop completed with undelivered notifications.Browser
- ReferenceError: window is not definedNext.js
- Error: Event handlers cannot be passed to Client Component props.Next.js
- Only plain objects, and a few built-ins, can be passed to Client Components from Server...Next.js
- Route "/orders/[id]" used `params.id`. `params` should be awaited before using its...Next.js
- Error: NEXT_REDIRECTNext.js
- Error: NextRouter was not mounted.Next.js
- Invalid src prop (https://cdn.example.com/p/42.jpg) on `next/image`, hostname...Next.js
- TypeError: Failed to parse URL from /api/ordersNext.js
- Too many re-renders. React limits the number of renders to prevent an infinite loop.Next.js
- useSearchParams() should be wrapped in a suspense boundary at page "/search".Next.js
- You're importing a module that depends on `useState` into a React Server Component...Next.js
- Objects are not valid as a React child (found: object with keys {id, name, total}). If...Next.js
- Element type is invalid: expected a string (for built-in components) or a class/function...Next.js
- Failed to find Server Action "7f3a9c2e5d1b4a6f8c0e2d7b9a1c3e5f7d9b0a2c4e". This request...Next.js
- ChunkLoadError: Loading chunk 4512 failed. (error...Next.js
Other error topics
- 422 Unprocessable Entity: {"detail":[{"type":"missing","loc":["body","email"],"msg":"Field...Network and HTTP
- TypeError: fetch failedNetwork and HTTP
- requests.exceptions.ConnectionError: HTTPSConnectionPool(host='api.example.com'...Network and HTTP
- error: relation "todo" does not existDatabases
- sqlalchemy.exc.PendingRollbackError: This Session's transaction has been rolled back due...Databases
- [ioredis] Unhandled error event: Error: connect ECONNREFUSED 127.0.0.1:6379Databases
- TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for /app/src/index.tsImports and modules
- ModuleNotFoundError: No module named 'x'Imports and modules
- TypeError: 'module' object is not callableImports and modules
- System.NullReferenceException: Object reference not set to an instance of an object.Undefined, None and type errors
- AttributeError: 'NoneType' object has no attribute 'x'Undefined, None and type errors
- RuntimeError: dictionary changed size during iterationUndefined, None and type errors
- TypeError: Object of type datetime is not JSON serializableJSON, parsing and validation
- SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSONJSON, parsing and validation
- ZodError: [ { "expected": "string", "code": "invalid_type", "path": [ "email" ]...JSON, parsing and validation
- PermissionError: [Errno 13] Permission denied: '/app/data/report.csv'Memory, async and the process
- RangeError: Maximum call stack size exceededMemory, async and the process
- Error: error:0308010C:digital envelope routines::unsupportedMemory, async and the process
- Not Acceptable: Client must accept both application/json and text/event-streamMCP servers and clients
- Bad Request: Unsupported protocol version: 2026-07-28MCP servers and clients
- MCP error -32602: Input validation error: Invalid arguments for tool get_orderMCP servers and clients
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.