Error map

Server actions must be async functions Next.js: Error: Server actions must be async functions

Next.js · layer 1, On your device

Open the full error page →

Centre: this error. First ring: errors it is linked with (8). Outer ring: what those are linked with. Colours show the layer of a request each error belongs to. Click any dot to re-centre the map on it; hover to follow its connections. The centre dot opens the error page.

Server actions must be async functions — Next.js: Error: Server actions must be async functions (Next.js)Server acti…Conflicting app and page file was found — Next.js: ⨯ Conflicting app and page file was found, please remove the conflicting files to continue: "pages/index.tsx" - "app/page.tsx" (Next.js)Conflicting app and…CORS error calling Next.js API route / route handler — Browser: Access to fetch at 'https://api.example.com/api/data' from origin 'https://app.example.com' has been blocked by CORS policy (Next.js route handler) (Next.js)CORS error calling …Only plain objects can be passed to Client Components — Next.js: Error: Only plain objects, and a few built-ins, can be passed to Client Components from Server Components. Classes or null prototypes are not supported (Next.js)Only plain objects …next build: JavaScript heap out of memory — Next.js: FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory (during next build) (Next.js)next build: JavaScr…next build: fetch failed ECONNREFUSED (build-time API) — Next.js: Error occurred prerendering page "/blog" TypeError: fetch failed { cause: Error: connect ECONNREFUSED 127.0.0.1:3000 } (Next.js)next build: fetch f…Body exceeded 1 MB limit (Server Actions) — Next.js: Error: Body exceeded 1 MB limit. To configure the body size limit for Server Actions, see: https://nextjs.org/docs/app/api-reference/next-config-js/serverActions#bodysizelimit (Next.js)Body exceeded 1 MB …Route used revalidatePath during render — Next.js: Error: Route /blog used "revalidatePath /blog" during render which is unsupported. It must happen outside of renders and cached functions (Next.js)Route used revalida…Failed to find Server Action — Next.js: Error: Failed to find Server Action "abc123". This request might be from an older or newer deployment (Next.js)Failed to find Serv…path-to-regexp — TypeError: Missing parameter name at 1 (path-to-regexp) (Node.js)path-to-regexpNo routes matched — No routes matched location "/x" (React)No routes matchedPrerender error — Error occurred prerendering page "/x". Read more: https://nextjs.org/docs/messages/prerender-error (React)Prerender errorCORS blocked (Laravel API) — Browser: Access to XMLHttpRequest at 'https://api.example.com' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header — Laravel (Laravel)CORS blocked (Larav…Hydration error: <div> cannot be a descendant of <p> — Next.js: Warning: validateDOMNesting(...): <div> cannot appear as a descendant of <p> / In HTML, <p> cannot be a descendant of <p>. This will cause a hydration error (Next.js)Hydration error: <d…createContext only works in Client Components — Next.js: You're importing a component that needs createContext. It only works in a Client Component but none of its parents are marked with "use client" (Next.js)createContext only …circular JSON — TypeError: Converting circular structure to JSON (JavaScript)circular JSONCastError ObjectId — CastError: Cast to ObjectId failed for value "x" (type string) at path "_id" (Node.js)CastError ObjectIdFunctions cannot be passed — Error: Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with "use server". (React)Functions cannot be…ELIFECYCLE — npm ERR! code ELIFECYCLE / Command failed with exit code 1 (npm)ELIFECYCLEgyp ERR! — gyp ERR! build error / node-gyp rebuild failed (npm)gyp ERR!heap out of memory — FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory (Node.js)heap out of memoryERR_OSSL_EVP_UNSUPPORTED — Error: error:0308010C:digital envelope routines::unsupported (Node.js)ERR_OSSL_EVP_UNSUPP…prisma generate — Error: @prisma/client did not initialize yet. Please run "prisma generate" (Node.js)prisma generatenode-sass — Error: Node Sass does not yet support your current environment (Node.js)node-sass413 — HTTP 413 Content Too Large (Request Entity Too Large) (HTTP)413Vercel FUNCTION_PAYLOAD_TOO_LARGE (413) — Vercel: 413 FUNCTION_PAYLOAD_TOO_LARGE — Request Entity Too Large (4.5 MB limit) (Next.js)Vercel FUNCTION_PAY…nginx: client intended to send too large body — Nginx: [error] client intended to send too large body: 5242880 bytes (413 Request Entity Too Large) (Nginx / Apache)nginx: client inten…Dynamic server usage — Error: Dynamic server usage: Route /x couldn't be rendered statically because it used `cookies` (React)Dynamic server usageUsed cookies/headers inside a function cached with unstable_cache — Next.js: Route used `cookies()` inside a function cached with `unstable_cache(...)`. Accessing Dynamic data sources inside a cache scope is not supported (Next.js)Used cookies/header…Failed to set Next.js data cache, items over 2MB can not be cached — Next.js: Failed to set Next.js data cache for https://api.example.com/data, items over 2MB can not be cached (2437412 bytes) (Next.js)Failed to set Next.…Unexpected token < — SyntaxError: Unexpected token '<' (HTML served instead of JavaScript) (JavaScript)Unexpected token <MIME type not executable — Refused to execute script from 'x' because its MIME type ('text/html') is not executable (JavaScript)MIME type not execu…ChunkLoadError — ChunkLoadError: Loading chunk 123 failed. (JavaScript)ChunkLoadError

Directly related (8)

Conflicting app and page file was foundNext.js

Next.js: ⨯ Conflicting app and page file was found, please remove the conflicting files to continue: "pages/index.tsx" - "app/page.tsx"

The same URL is defined in both the `app` and `pages` directories.

CORS error calling Next.js API route / route handlerNext.js

Browser: Access to fetch at 'https://api.example.com/api/data' from origin 'https://app.example.com' has been blocked by CORS policy (Next.js route handler)

A cross-origin request to your Next.js API route is blocked because the response lacks CORS headers.

Only plain objects can be passed to Client ComponentsNext.js

Next.js: Error: Only plain objects, and a few built-ins, can be passed to Client Components from Server Components. Classes or null prototypes are not supported

A Server Component passed a non-serialisable value (class instance, Date-like object, Mongoose doc, Map) as a prop to a Client Co…

next build: JavaScript heap out of memoryNext.js

Next.js: FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory (during next build)

Node ran out of memory while building a large Next.js app (or on a small CI/Vercel runner).

next build: fetch failed ECONNREFUSED (build-time API)Next.js

Next.js: Error occurred prerendering page "/blog" TypeError: fetch failed { cause: Error: connect ECONNREFUSED 127.0.0.1:3000 }

During `next build` a page tried to fetch data from a server (often your own app or an API) that isn't running yet.

Body exceeded 1 MB limit (Server Actions)Next.js

Next.js: Error: Body exceeded 1 MB limit. To configure the body size limit for Server Actions, see: https://nextjs.org/docs/app/api-reference/next-config-js/serverActions#bodysizelimit

A Server Action (often a file upload) sent more than the default 1 MB request body.

Route used revalidatePath during renderNext.js

Next.js: Error: Route /blog used "revalidatePath /blog" during render which is unsupported. It must happen outside of renders and cached functions

`revalidatePath`/`revalidateTag` was called while rendering a page or component, not from an action or route handler.

Failed to find Server ActionNext.js

Next.js: Error: Failed to find Server Action "abc123". This request might be from an older or newer deployment

The browser called a Server Action ID the current server build doesn't know — usually a version skew after a deploy.

Two steps away (24)

path-to-regexpNode.js

TypeError: Missing parameter name at 1 (path-to-regexp)

An Express 5 (path-to-regexp v8) route uses old wildcard syntax like '*' or '/:id?'.

No routes matchedReact

No routes matched location "/x"

React Router found no route definition for the current URL.

Prerender errorReact

Error occurred prerendering page "/x". Read more: https://nextjs.org/docs/messages/prerender-error

A page threw an error while Next.js was rendering it at build time.

CORS blocked (Laravel API)Laravel

Browser: Access to XMLHttpRequest at 'https://api.example.com' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header — Laravel

The browser blocked a cross-origin call to your Laravel API because the response lacks the right CORS headers.

Hydration error: <div> cannot be a descendant of <p>Next.js

Next.js: Warning: validateDOMNesting(...): <div> cannot appear as a descendant of <p> / In HTML, <p> cannot be a descendant of <p>. This will cause a hydration error

The rendered HTML has an invalid element nesting, so the browser "fixes" it and React's hydration no longer matches.

createContext only works in Client ComponentsNext.js

Next.js: You're importing a component that needs createContext. It only works in a Client Component but none of its parents are marked with "use client"

A context provider (or a lib that uses `createContext`) is used in a Server Component.

circular JSONJavaScript

TypeError: Converting circular structure to JSON

JSON.stringify met an object that references itself (directly or through children).

CastError ObjectIdNode.js

CastError: Cast to ObjectId failed for value "x" (type string) at path "_id"

A value that isn’t a valid 24-hex-character ObjectId was used in an _id query.

Functions cannot be passedReact

Error: Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with "use server".

A Server Component passed a function prop to a Client Component.

ELIFECYCLEnpm

npm ERR! code ELIFECYCLE / Command failed with exit code 1

An npm script (build, start, test, postinstall) exited with an error. ELIFECYCLE is only the wrapper — the real error is printed…

gyp ERR!npm

gyp ERR! build error / node-gyp rebuild failed

A dependency with native C/C++ code couldn’t compile — missing build tools, Python, or an unsupported Node version.

heap out of memoryNode.js

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory

The V8 heap hit its limit — a large build (webpack, tsc, Next.js) needs more memory, or the app leaks.

ERR_OSSL_EVP_UNSUPPORTEDNode.js

Error: error:0308010C:digital envelope routines::unsupported

An old build tool (webpack 4, old react-scripts) uses a hash algorithm that OpenSSL 3 in Node 17+ disables.

prisma generateNode.js

Error: @prisma/client did not initialize yet. Please run "prisma generate"

The generated Prisma Client is missing or out of date.

node-sassNode.js

Error: Node Sass does not yet support your current environment

node-sass (deprecated) has no binary for your Node version/OS.

413HTTP

HTTP 413 Content Too Large (Request Entity Too Large)

The request body is bigger than the server is willing to accept — usually a file upload over the configured limit.

Vercel FUNCTION_PAYLOAD_TOO_LARGE (413)Next.js

Vercel: 413 FUNCTION_PAYLOAD_TOO_LARGE — Request Entity Too Large (4.5 MB limit)

A request or response exceeded Vercel's 4.5 MB serverless function payload limit.

nginx: client intended to send too large bodyNginx / Apache

Nginx: [error] client intended to send too large body: 5242880 bytes (413 Request Entity Too Large)

A request body exceeded `client_max_body_size` (default 1 MB), so Nginx returned 413 before reaching your app.

Dynamic server usageReact

Error: Dynamic server usage: Route /x couldn't be rendered statically because it used `cookies`

Next.js tried to statically render a route that reads request-specific data (cookies, headers, searchParams).

Used cookies/headers inside a function cached with unstable_cacheNext.js

Next.js: Route used `cookies()` inside a function cached with `unstable_cache(...)`. Accessing Dynamic data sources inside a cache scope is not supported

A cached function reads request-specific data (cookies, headers), which would leak between users.

Failed to set Next.js data cache, items over 2MB can not be cachedNext.js

Next.js: Failed to set Next.js data cache for https://api.example.com/data, items over 2MB can not be cached (2437412 bytes)

A `fetch` response was too large for Next.js's data cache (limit 2 MB), so it wasn't cached.

Unexpected token <JavaScript

SyntaxError: Unexpected token '<' (HTML served instead of JavaScript)

The browser loaded a .js file but received HTML (an error page or the SPA index.html).

MIME type not executableJavaScript

Refused to execute script from 'x' because its MIME type ('text/html') is not executable

The browser fetched a script but the server labelled it text/html (usually an error page), so it refused to run it.

ChunkLoadErrorJavaScript

ChunkLoadError: Loading chunk 123 failed.

A lazily loaded JavaScript chunk couldn’t be downloaded — usually because a new deployment removed the old hashed files.