Error map

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

Open the full error page →

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

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…path-to-regexp — TypeError: Missing parameter name at 1 (path-to-regexp) (Node.js)path-to-regexpPrerender error — Error occurred prerendering page "/x". Read more: https://nextjs.org/docs/messages/prerender-error (React)Prerender errorNo routes matched — No routes matched location "/x" (React)No routes matchedNextRouter was not mounted — Error: NextRouter was not mounted. (React)NextRouter was not …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…ReferenceError: document is not defined — Next.js: ReferenceError: document is not defined (Next.js)ReferenceError: doc…ReferenceError: localStorage is not defined — Next.js: ReferenceError: localStorage is not defined / sessionStorage is not defined (Next.js)ReferenceError: loc…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 …Invalid next.config.js options detected — Next.js: Invalid next.config.js options detected: Unrecognized key(s) in object: 'xyz' (Next.js)Invalid next.config…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 …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 prop type: The prop href expects a string or object in <Link> — Next.js: Error: Failed prop type: The prop `href` expects a `string` or `object` in `<Link>`, but got `undefined` instead (Next.js)Failed prop type: T…404 — HTTP 404 Not Found (HTTP)404405 — HTTP 405 Method Not Allowed (HTTP)405Whitelabel Error Page — Whitelabel Error Page — This application has no explicit mapping for /error (Java)Whitelabel Error Pa…Hydration failed — Error: Hydration failed because the initial UI does not match what was rendered on the server (React)Hydration failedCan't resolve 'fs' — Module not found: Can't resolve 'fs' (Next.js / webpack 5) (React)Can't resolve 'fs'needs useState — You're importing a component that needs useState. It only works in a Client Component but none of its parents are marked with "use client" (React)needs useStateuseNavigate outside Router — Error: useNavigate() may be used only in the context of a <Router> component. (React)useNavigate outside…Cannot GET — API Error: Cannot GET /api/... / No route matches / The route could not be found (API)Cannot GETNetwork is unreachable — connect: Network is unreachable (ENETUNREACH) (Linux)Network is unreacha…Dynamic server usage — Error: Dynamic server usage: Route /x couldn't be rendered statically because it used `cookies` (React)Dynamic server usagenext/image hostname — Error: Invalid src prop on `next/image`, hostname "x" is not configured under images in your `next.config.js` (React)next/image hostnameFunctions 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…validateDOMNesting — Warning: validateDOMNesting(...): <div> cannot appear as a descendant of <p>. (React)validateDOMNestingReferenceError: window is not defined — Next.js: ReferenceError: window is not defined (server-side rendering) (Next.js)ReferenceError: win…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…useLayoutEffect 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 matchTypeError: 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…QuotaExceededError — QuotaExceededError: Failed to execute 'setItem' on 'Storage': Setting the value exceeded the quota (JavaScript)QuotaExceededErrornext 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…[Vue warn]: Hydration node/text/children mismatch — Vue: [Vue warn]: Hydration text content mismatch / Hydration node mismatch: server rendered element contains more child nodes than client vdom (Vue)[Vue warn]: Hydrati…CORS 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…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 …Route used params.x — params should be awaited — Next.js 15: Error: Route "/blog/[slug]" used `params.slug`. `params` should be awaited before using its properties (Next.js)Route used params.x…next.config.js: ES Module / require error — Next.js: Error [ERR_REQUIRE_ESM]: require() of ES Module next.config.js / SyntaxError: Unexpected token 'export' (Next.js)next.config.js: ES …Features not supported with output: export (headers, redirects, image loader) — Next.js: Specified "headers" cannot be used with "output: export" / Image Optimization using the default loader is not compatible with `{ output: 'export' }` (Next.js)Features not suppor…Middleware matcher: Capturing groups are not allowed — Next.js: Error: Invalid middleware found. Capturing groups are not allowed in matcher / `matcher` values must start with `/` (Next.js)Middleware matcher:…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 ObjectIdServer actions must be async functions — Next.js: Error: Server actions must be async functions (Next.js)Server actions must…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…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.…non-boolean attribute — Warning: Received `true` for a non-boolean attribute `x`. (React)non-boolean attribu…key is not a prop — Warning: `key` is not a prop. Trying to access it will result in `undefined` being returned. (React)key is not a propInvalid <Link> with <a> child. Please remove <a> — Next.js 13+: Error: Invalid <Link> with <a> child. Please remove <a> or use <Link legacyBehavior> (Next.js)Invalid <Link> with…

Directly related (12)

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?'.

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.

No routes matchedReact

No routes matched location "/x"

React Router found no route definition for the current URL.

NextRouter was not mountedReact

Error: NextRouter was not mounted.

next/router’s useRouter was used inside the App Router (app/ directory), which uses next/navigation instead.

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.

ReferenceError: document is not definedNext.js

Next.js: ReferenceError: document is not defined

Code used the DOM (`document`) while rendering on the server.

ReferenceError: localStorage is not definedNext.js

Next.js: ReferenceError: localStorage is not defined / sessionStorage is not defined

`localStorage`/`sessionStorage` was read during server rendering.

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.

Invalid next.config.js options detectedNext.js

Next.js: Invalid next.config.js options detected: Unrecognized key(s) in object: 'xyz'

`next.config.js` contains an option Next.js doesn't recognise (typo, wrong version, or moved key).

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…

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 prop type: The prop href expects a string or object in <Link>Next.js

Next.js: Error: Failed prop type: The prop `href` expects a `string` or `object` in `<Link>`, but got `undefined` instead

`` received `undefined` (or another invalid value), so Next.js can't build the link.

Two steps away (35)

404HTTP

HTTP 404 Not Found

The server can’t find anything at the requested URL.

405HTTP

HTTP 405 Method Not Allowed

The URL exists, but it doesn’t accept the HTTP method you used (e.g. POST to a GET-only route).

Whitelabel Error PageJava

Whitelabel Error Page — This application has no explicit mapping for /error

Spring Boot’s default error page — the request hit no controller mapping (404) or a controller threw (500).

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.

Can't resolve 'fs'React

Module not found: Can't resolve 'fs' (Next.js / webpack 5)

A Node.js built-in (fs, path, crypto, net) is imported into code that runs in the browser bundle.

needs useStateReact

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

In the Next.js App Router, a component using hooks or browser APIs is rendered as a Server Component.

useNavigate outside RouterReact

Error: useNavigate() may be used only in the context of a <Router> component.

A React Router hook ran in a component that isn’t rendered inside a Router provider.

Cannot GETAPI

API Error: Cannot GET /api/... / No route matches / The route could not be found

The server has no route for this URL and HTTP method combination — the endpoint path, API version prefix or method is wrong.

Network is unreachableLinux

connect: Network is unreachable (ENETUNREACH)

The host has no route to the destination network — no default gateway, interface down, or trying IPv6 without IPv6 connectivity.

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

next/image hostnameReact

Error: Invalid src prop on `next/image`, hostname "x" is not configured under images in your `next.config.js`

next/image refuses to optimize images from domains not allowed in next.config.js.

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.

validateDOMNestingReact

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

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

ReferenceError: window is not definedNext.js

Next.js: ReferenceError: window is not defined (server-side rendering)

Code touching the browser's `window` ran on the server during SSR/build, where it doesn't exist.

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

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.

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.

QuotaExceededErrorJavaScript

QuotaExceededError: Failed to execute 'setItem' on 'Storage': Setting the value exceeded the quota

localStorage/sessionStorage is full (about 5 MB per origin) or storage is disabled.

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.

[Vue warn]: Hydration node/text/children mismatchVue

Vue: [Vue warn]: Hydration text content mismatch / Hydration node mismatch: server rendered element contains more child nodes than client vdom

Server-rendered HTML differs from what the client renders on first load.

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.

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.

Route used params.x — params should be awaitedNext.js

Next.js 15: Error: Route "/blog/[slug]" used `params.slug`. `params` should be awaited before using its properties

In Next.js 15 `params` and `searchParams` are Promises; reading properties synchronously triggers this error/warning.

next.config.js: ES Module / require errorNext.js

Next.js: Error [ERR_REQUIRE_ESM]: require() of ES Module next.config.js / SyntaxError: Unexpected token 'export'

The config file uses ESM syntax in a CommonJS context (or the reverse), so Node can't load it.

Features not supported with output: export (headers, redirects, image loader)Next.js

Next.js: Specified "headers" cannot be used with "output: export" / Image Optimization using the default loader is not compatible with `{ output: 'export' }`

Static export (`output: 'export'`) can't use server features like rewrites/headers/redirects, default image optimisation, middlew…

Middleware matcher: Capturing groups are not allowedNext.js

Next.js: Error: Invalid middleware found. Capturing groups are not allowed in matcher / `matcher` values must start with `/`

The `config.matcher` regex in middleware contains an unsupported pattern (capturing group) or invalid syntax.

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.

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

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.

non-boolean attributeReact

Warning: Received `true` for a non-boolean attribute `x`.

A boolean was passed to a DOM attribute that expects a string, or a custom prop leaked through to a DOM element.

key is not a propReact

Warning: `key` is not a prop. Trying to access it will result in `undefined` being returned.

A component tried to read props.key, which React reserves and never passes down.

Invalid <Link> with <a> child. Please remove <a>Next.js

Next.js 13+: Error: Invalid <Link> with <a> child. Please remove <a> or use <Link legacyBehavior>

Since Next.js 13 `` renders its own ``, so nesting your own `` is invalid.