Error map

'sharp' is required to be installed in standalone mode Next.js: Error: 'sharp' is required to be installed in standalone mode for the image optimization to function correctly

Next.js · layer 1, On your device

Open the full error page →

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

'sharp' is required to be installed in standalone mode — Next.js: Error: 'sharp' is required to be installed in standalone mode for the image optimization to function correctly (Next.js)'sharp' is …next/image hostname — Error: Invalid src prop on `next/image`, hostname "x" is not configured under images in your `next.config.js` (React)next/image hostnameEBADPLATFORM — npm ERR! code EBADPLATFORM — notsup Unsupported platform for fsevents: wanted {"os":"darwin"} (current: {"os":"linux"}) (npm)EBADPLATFORMsharp module — Error: Could not load the "sharp" module using the linux-x64 runtime (npm)sharp moduleinvalid ELF header — Error: /app/node_modules/bcrypt/lib/binding/bcrypt_lib.node: invalid ELF header (npm)invalid ELF headeresbuild wrong platform — You installed esbuild for another platform than the one you're currently using. (npm)esbuild wrong platf…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 …_next/image 400 / upstream image response failed — Next.js: ⨯ upstream image response failed for https://example.com/a.jpg 404 / url parameter is not allowed (Next.js)_next/image 400 / u…Image with src must use "width" and "height" properties or "fill" — Next.js: Image with src "https://example.com/a.jpg" must use "width" and "height" properties or "fill" property (Next.js)Image with src must…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…ImagePullBackOff — Kubernetes: ImagePullBackOff / ErrImagePull (Kubernetes)ImagePullBackOffexec format error — exec /usr/local/bin/docker-entrypoint.sh: exec format error (Docker)exec format errorHydration failed — Error: Hydration failed because the initial UI does not match what was rendered on the server (React)Hydration failedERESOLVE — npm ERR! code ERESOLVE — unable to resolve dependency tree (npm)ERESOLVEE404 — npm ERR! code E404 — 404 Not Found: package@version is not in this registry (npm)E404ETARGET — npm ERR! code ETARGET — No matching version found for package@^9.9.9 (npm)ETARGETgyp ERR! — gyp ERR! build error / node-gyp rebuild failed (npm)gyp ERR!No Xcode or CLT — gyp: No Xcode or CLT version detected! (npm)No Xcode or CLTrollup native module — Error: Cannot find module @rollup/rollup-linux-x64-gnu. npm has a bug related to optional dependencies (npm)rollup native moduledata directory permissions — FATAL: data directory "/var/lib/postgresql/data" has invalid permissions — Permissions should be u=rwx (0700) or u=rwx,g=rx (0750). (PostgreSQL)data directory perm…incompatible data directory — FATAL: database files are incompatible with server — The data directory was initialized by PostgreSQL version 15, which is not compatible with this version 16 (PostgreSQL)incompatible data d…Docker Desktop requires privileged access (vmnetd) — macOS: Docker Desktop needs privileged access / com.docker.vmnetd could not be started (macOS)Docker Desktop requ…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 …ELIFECYCLE — npm ERR! code ELIFECYCLE / Command failed with exit code 1 (npm)ELIFECYCLEheap out of memory — FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory (Node.js)heap out of memoryinvalid string length — RangeError: Invalid string length (JavaScript)invalid string leng…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 (11)

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.

EBADPLATFORMnpm

npm ERR! code EBADPLATFORM — notsup Unsupported platform for fsevents: wanted {"os":"darwin"} (current: {"os":"linux"})

A package restricted to certain OS/CPU was installed as a required (not optional) dependency on another platform.

sharp modulenpm

Error: Could not load the "sharp" module using the linux-x64 runtime

sharp’s native binary for this OS/CPU isn’t installed — usually node_modules installed on another platform (Mac → Linux/Docker).

invalid ELF headernpm

Error: /app/node_modules/bcrypt/lib/binding/bcrypt_lib.node: invalid ELF header

A native module compiled for macOS/Windows is being loaded on Linux.

esbuild wrong platformnpm

You installed esbuild for another platform than the one you're currently using.

node_modules contains esbuild’s binary for a different OS/CPU.

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.

_next/image 400 / upstream image response failedNext.js

Next.js: ⨯ upstream image response failed for https://example.com/a.jpg 404 / url parameter is not allowed

The Image Optimization API couldn't fetch or accept the source image (404, blocked host, wrong type).

Image with src must use "width" and "height" properties or "fill"Next.js

Next.js: Image with src "https://example.com/a.jpg" must use "width" and "height" properties or "fill" property

`next/image` needs dimensions (or `fill`) for remote images so it can reserve space and avoid layout shift.

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.

Two steps away (24)

ImagePullBackOffKubernetes

Kubernetes: ImagePullBackOff / ErrImagePull

The node can’t pull the container image — wrong name/tag, missing registry credentials, or registry unreachable.

exec format errorDocker

exec /usr/local/bin/docker-entrypoint.sh: exec format error

The container tried to run a binary built for a different CPU architecture (arm64 vs amd64) — or a script with a broken shebang /…

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.

ERESOLVEnpm

npm ERR! code ERESOLVE — unable to resolve dependency tree

npm 7+ found conflicting peer dependency requirements and refuses to install a broken tree.

E404npm

npm ERR! code E404 — 404 Not Found: package@version is not in this registry

npm asked the registry for a package (or version) that doesn’t exist there — a typo, a private/scoped package without auth, or th…

ETARGETnpm

npm ERR! code ETARGET — No matching version found for package@^9.9.9

The version range in package.json doesn’t match any published version of the package.

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.

No Xcode or CLTnpm

gyp: No Xcode or CLT version detected!

node-gyp on macOS can’t find the Xcode Command Line Tools to compile native modules.

rollup native modulenpm

Error: Cannot find module @rollup/rollup-linux-x64-gnu. npm has a bug related to optional dependencies

Rollup’s (and Vite’s) platform-specific optional dependency wasn’t installed — an npm optional-dependency bug with lockfiles from…

data directory permissionsPostgreSQL

FATAL: data directory "/var/lib/postgresql/data" has invalid permissions — Permissions should be u=rwx (0700) or u=rwx,g=rx (0750).

PostgreSQL refuses to start because the data directory is too open or owned by the wrong user.

incompatible data directoryPostgreSQL

FATAL: database files are incompatible with server — The data directory was initialized by PostgreSQL version 15, which is not compatible with this version 16

A newer (or older) PostgreSQL major version was started on an existing data directory.

Docker Desktop requires privileged access (vmnetd)macOS

macOS: Docker Desktop needs privileged access / com.docker.vmnetd could not be started

Docker Desktop couldn't install or start its privileged helper, so it can't set up networking.

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.

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…

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.

invalid string lengthJavaScript

RangeError: Invalid string length

A string grew beyond the engine’s maximum length — usually runaway concatenation or huge JSON.stringify output.

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.