Error map

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

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)createConte…No QueryClient set — Error: No QueryClient set, use QueryClientProvider to set one (React)No QueryClient setFunctions 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…useNavigate outside Router — Error: useNavigate() may be used only in the context of a <Router> component. (React)useNavigate outside…useContext undefined — TypeError: Cannot destructure property 'user' of 'useContext(...)' as it is undefined. (React)useContext undefinedserver-only — Next.js: You're importing a component that needs "server-only". That only works in a Server Component (Next.js)server-onlyneeds 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 useStateCORS 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 …You have a Server Component that imports next/router. Use next/navigation instead — Next.js: You have a Server Component that imports next/router. Use next/navigation instead (Next.js)You have a Server C…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…No HTTP methods exported in route.ts — Next.js: Error: No HTTP methods exported in '/app/api/users/route.ts'. Export a named export for each HTTP method (GET, POST...) (Next.js)No HTTP methods exp…You are attempting to export "metadata" from a component marked with "use client" — Next.js: You are attempting to export "metadata" from a component marked with "use client", which is disallowed (Next.js)You are attempting …You cannot use different slug names for the same dynamic path — Next.js: Error: You cannot use different slug names for the same dynamic path ('id' !== 'slug') (Next.js)You cannot use diff…uncontrolled to controlled — Warning: A component is changing an uncontrolled input to be controlled (React)uncontrolled to con…Flask app context — RuntimeError: Working outside of application context. (Python)Flask app contextAdjacent JSX elements — Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>? (React)Adjacent JSX elemen…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'Dynamic server usage — Error: Dynamic server usage: Route /x couldn't be rendered statically because it used `cookies` (React)Dynamic server usagesetState during render — Warning: Cannot update a component (`Parent`) while rendering a different component (`Child`) (React)setState during ren…No routes matched — No routes matched location "/x" (React)No routes matchednot wrapped in act — Warning: An update to Component inside a test was not wrapped in act(...) (React)not wrapped in actTypeError — TypeError: Cannot read properties of undefined (reading 'x') (JavaScript)TypeErrorTypeError set undefined — TypeError: Cannot set properties of undefined (setting 'x') (JavaScript)TypeError set undef…TypeError not iterable — TypeError: x is not iterable (JavaScript)TypeError not itera…async Client Component — Error: async/await is not yet supported in Client Components, only Server Components. (React)async Client Compon…NEXT_REDIRECT — Next.js: Error: NEXT_REDIRECT (redirect() inside try/catch) (Next.js)NEXT_REDIRECTcookies() 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…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 hostnamePrerender error — Error occurred prerendering page "/x". Read more: https://nextjs.org/docs/messages/prerender-error (React)Prerender errorNextRouter was not mounted — Error: NextRouter was not mounted. (React)NextRouter was not …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…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…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…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…Invalid <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…NavigationDuplicated: Avoided redundant navigation to current location — Vue Router: Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation to current location: "/home" (Vue)NavigationDuplicate…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!ERR_OSSL_EVP_UNSUPPORTED — Error: error:0308010C:digital envelope routines::unsupported (Node.js)ERR_OSSL_EVP_UNSUPP…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…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…path-to-regexp — TypeError: Missing parameter name at 1 (path-to-regexp) (Node.js)path-to-regexpPage is missing generateStaticParams() (output: export) — Next.js: Page "/blog/[slug]" is missing "generateStaticParams()" so it cannot be used with "output: export" config (Next.js)Page is missing gen…[Vue Router warn]: No match found for location with path — Vue Router: [Vue Router warn]: No match found for location with path "/users/42" (Vue)[Vue Router warn]: …

Directly related (12)

No QueryClient setReact

Error: No QueryClient set, use QueryClientProvider to set one

TanStack Query hooks ran outside a QueryClientProvider (or a duplicate copy of the library is installed).

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.

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.

useContext undefinedReact

TypeError: Cannot destructure property 'user' of 'useContext(...)' as it is undefined.

A component read a context with no matching Provider above it.

server-onlyNext.js

Next.js: You're importing a component that needs "server-only". That only works in a Server Component

A Client Component (or a file it imports) pulls in server-only code — database clients, secrets, next/headers or a module marked…

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.

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.

You have a Server Component that imports next/router. Use next/navigation insteadNext.js

Next.js: You have a Server Component that imports next/router. Use next/navigation instead

`next/router` (Pages Router) was imported in an App Router component.

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.

No HTTP methods exported in route.tsNext.js

Next.js: Error: No HTTP methods exported in '/app/api/users/route.ts'. Export a named export for each HTTP method (GET, POST...)

A Route Handler file exports no recognised HTTP method function.

You are attempting to export "metadata" from a component marked with "use client"Next.js

Next.js: You are attempting to export "metadata" from a component marked with "use client", which is disallowed

`metadata`/`generateMetadata` can only be exported from Server Components.

You cannot use different slug names for the same dynamic pathNext.js

Next.js: Error: You cannot use different slug names for the same dynamic path ('id' !== 'slug')

Sibling dynamic folders at the same level use different parameter names.

Two steps away (32)

uncontrolled to controlledReact

Warning: A component is changing an uncontrolled input to be controlled

An input’s `value` started as `undefined` (uncontrolled) and later became a defined value (controlled), or vice versa.

Flask app contextPython

RuntimeError: Working outside of application context.

Code used current_app, g, or a Flask extension (like SQLAlchemy) without an active Flask application context.

Adjacent JSX elementsReact

Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>?

A component returns two sibling JSX elements without a single parent.

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.

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

setState during renderReact

Warning: Cannot update a component (`Parent`) while rendering a different component (`Child`)

A child component updated a parent’s state during its render instead of in an effect or event handler.

No routes matchedReact

No routes matched location "/x"

React Router found no route definition for the current URL.

not wrapped in actReact

Warning: An update to Component inside a test was not wrapped in act(...)

A component updated state after the test’s synchronous assertions — async work wasn’t awaited.

TypeErrorJavaScript

TypeError: Cannot read properties of undefined (reading 'x')

You tried to access a property on a value that is `undefined` (or `null`) — usually data that hasn’t loaded yet or a wrong proper…

TypeError set undefinedJavaScript

TypeError: Cannot set properties of undefined (setting 'x')

Code assigned a property on a value that is undefined (or null).

TypeError not iterableJavaScript

TypeError: x is not iterable

for…of, spread or destructuring was used on something that isn’t an array/iterable.

async Client ComponentReact

Error: async/await is not yet supported in Client Components, only Server Components.

A component marked "use client" was declared async.

NEXT_REDIRECTNext.js

Next.js: Error: NEXT_REDIRECT (redirect() inside try/catch)

redirect() works by throwing a special error; catching it in try/catch (or a .catch) swallows the redirect and logs NEXT_REDIRECT.

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.

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.

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.

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.

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.

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.

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.

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.

NavigationDuplicated: Avoided redundant navigation to current locationVue

Vue Router: Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation to current location: "/home"

`router.push` to the route you're already on, rejecting the promise (Vue Router 3.1+).

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.

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.

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

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

Page is missing generateStaticParams() (output: export)Next.js

Next.js: Page "/blog/[slug]" is missing "generateStaticParams()" so it cannot be used with "output: export" config

A dynamic route can't be statically exported without telling Next.js which paths to generate.

[Vue Router warn]: No match found for location with pathVue

Vue Router: [Vue Router warn]: No match found for location with path "/users/42"

The router has no route record matching that path (typo, missing route, or case/base issue).