Error map

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 · layer 1, On your device

Open the full error page →

Centre: this error. First ring: errors it is linked with (7). 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.

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 s…Dynamic server usage — Error: Dynamic server usage: Route /x couldn't be rendered statically because it used `cookies` (React)Dynamic server usageConflicting 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…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…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…TypeError: Failed to parse URL from /api/... — Next.js: TypeError: Failed to parse URL from /api/posts (fetch in a Server Component) (Next.js)TypeError: Failed t…Used 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…unique key prop — Warning: Each child in a list should have a unique "key" prop (React)unique key propHydration failed — Error: Hydration failed because the initial UI does not match what was rendered on the server (React)Hydration failedElement type is invalid — Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined (React)Element type is inv…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 errorELIFECYCLE — 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-sassServer actions must be async functions — Next.js: Error: Server actions must be async functions (Next.js)Server actions must…validateDOMNesting — Warning: validateDOMNesting(...): <div> cannot appear as a descendant of <p>. (React)validateDOMNestinguseLayoutEffect SSR — Warning: useLayoutEffect does nothing on the server (React)useLayoutEffect SSRProp did not match — Warning: Prop `className` did not match. Server: "x" Client: "y" (React)Prop did not matchcookies() should be awaited — Next.js 15: Route "/x" used `cookies().get('token')`. `cookies()` should be awaited before using its value (Next.js)cookies() should be…

Directly related (7)

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).

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.

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.

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.

TypeError: Failed to parse URL from /api/...Next.js

Next.js: TypeError: Failed to parse URL from /api/posts (fetch in a Server Component)

`fetch('/api/x')` with a relative URL works in browsers but not on the server, which has no base URL.

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.

Two steps away (17)

unique key propReact

Warning: Each child in a list should have a unique "key" prop

When rendering a list with `.map()`, each element needs a stable, unique `key` so React can track items between renders.

Hydration failedReact

Error: Hydration failed because the initial UI does not match what was rendered on the server

The HTML rendered on the server differs from the first client render, so React (Next.js/Remix) can’t attach to it.

Element type is invalidReact

Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined

JSX referenced a component that is undefined — almost always a default/named import mismatch.

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.

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.

Server actions must be async functionsNext.js

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

A function marked `"use server"` isn't declared `async`.

validateDOMNestingReact

Warning: validateDOMNesting(...): <div> cannot appear as a descendant of <p>.

The JSX produces invalid HTML nesting, which also causes hydration mismatches in SSR.

useLayoutEffect SSRReact

Warning: useLayoutEffect does nothing on the server

A component using useLayoutEffect was server-rendered, where layout effects can’t run.

Prop did not matchReact

Warning: Prop `className` did not match. Server: "x" Client: "y"

A prop rendered on the server differs from the client — usually CSS-in-JS class names or random IDs.

cookies() should be awaitedNext.js

Next.js 15: Route "/x" used `cookies().get('token')`. `cookies()` should be awaited before using its value

Since Next.js 15, cookies(), headers(), params and searchParams are async — they must be awaited.