Error map

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

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 …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…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…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…Dynamic Code Evaluation not allowed in Edge Runtime — Next.js: Dynamic Code Evaluation (e. g. 'eval', 'new Function', 'WebAssembly.compile') not allowed in Edge Runtime (Next.js)Dynamic Code Evalua…The edge runtime does not support Node.js module — Next.js: The edge runtime does not support Node.js 'crypto' module / A Node.js module is loaded ('fs') which is not supported in the Edge Runtime (Next.js)The edge runtime do…ERR_TOO_MANY_REDIRECTS (Next.js middleware) — Browser: This page isn't working — redirected you too many times (ERR_TOO_MANY_REDIRECTS) with Next.js middleware / trailing slash (Next.js)ERR_TOO_MANY_REDIRE…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…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 errornext/image hostname — Error: Invalid src prop on `next/image`, hostname "x" is not configured under images in your `next.config.js` (React)next/image hostnamenext.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…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 memoryEdge Function size limit exceeded — Vercel: The Edge Function "middleware" size is 1.2 MB and your plan size limit is 1 MB. Learn More: https://vercel.link/edge-function-size (Next.js)Edge Function size …NO_SECRET — NextAuth / Auth.js: [next-auth][error][NO_SECRET] Please define a `secret` in production / MissingSecret (Authentication)NO_SECRETCORS 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 …ERR_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-sass

Directly related (7)

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.

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

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

Dynamic Code Evaluation not allowed in Edge RuntimeNext.js

Next.js: Dynamic Code Evaluation (e. g. 'eval', 'new Function', 'WebAssembly.compile') not allowed in Edge Runtime

Code in middleware or an Edge route uses `eval`/`new Function`, which the Edge Runtime forbids.

The edge runtime does not support Node.js moduleNext.js

Next.js: The edge runtime does not support Node.js 'crypto' module / A Node.js module is loaded ('fs') which is not supported in the Edge Runtime

Middleware or an Edge route imported a Node.js built-in (`fs`, `crypto`, `path`, `net`) that isn't available on the Edge.

ERR_TOO_MANY_REDIRECTS (Next.js middleware)Next.js

Browser: This page isn't working — redirected you too many times (ERR_TOO_MANY_REDIRECTS) with Next.js middleware / trailing slash

Middleware (or config redirects) keeps redirecting between the same URLs.

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.

Two steps away (15)

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.

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.

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…

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.

Edge Function size limit exceededNext.js

Vercel: The Edge Function "middleware" size is 1.2 MB and your plan size limit is 1 MB. Learn More: https://vercel.link/edge-function-size

Your middleware/Edge Function bundle is larger than the plan's size limit.

NO_SECRETAuthentication

NextAuth / Auth.js: [next-auth][error][NO_SECRET] Please define a `secret` in production / MissingSecret

Auth.js needs a secret (NEXTAUTH_SECRET / AUTH_SECRET) in production to sign and encrypt tokens/cookies.

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.

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.