Errors

Vibe coding errors, explained. Paste one, get the fix.

Stuck on an error? Find it here, read what it means in plain English, and copy a prompt your AI coding tool can use to fix it.

React and Next.js

Errors from components, hooks, and server rendering.

Hydration failed because the server rendered HTML didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used: - A server/client branch `if (typeof window !== 'undefined')`. - Variable input such as `Date.now()` or `Math.random()` which changes each time it's called. - Date formatting in a user's locale which doesn't match the server. - External changing data without sending a snapshot of it along with the HTML. - Invalid HTML tag nesting. It can also happen if the client has a browser extension installed which messes with the HTML before React loaded. https://react.dev/link/hydration-mismatch

Hydration failed

The HTML the server sent didn’t match what React rendered first in the browser, so React threw that part away and rebuilt it on the client.

Too many re-renders. React limits the number of renders to prevent an infinite loop.

Too many re-renders

A component changes its own state while it renders, so React renders it again and again until it stops the loop.

Each child in a list should have a unique "key" prop. Check the render method of `TodoList`. See https://react.dev/link/warning-keys for more information.

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

A list rendered with map gave its items no stable ID, so React can’t tell which item is which when the list changes.

Objects are not valid as a React child (found: object with keys {id, title}). If you meant to render a collection of children, use an array instead.

Objects are not valid as a React child

React was asked to show a whole object, such as a database row or a date, on the page, and it can only show text, numbers, and elements.

ReferenceError: window is not defined

ReferenceError: window is not defined

Code that only works in a browser ran on the server, where there is no window, document, or localStorage.

Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons: 1. You might have mismatching versions of React and the renderer (such as React DOM) 2. You might be breaking the Rules of Hooks 3. You might have more than one copy of React in the same app See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.

Invalid hook call

A hook such as useState ran somewhere React can’t track it, or the app loaded two copies of React that don’t know about each other.

Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.

Maximum update depth exceeded

State updates kept triggering more state updates in a loop, usually through an effect or a callback, so React stopped them.

Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports. Check the render method of `App`.

Element type is invalid

A JSX tag pointed at undefined or an object instead of a component, almost always because an import doesn’t match how the file exports it.

A component is changing an uncontrolled input to be controlled. This is likely caused by the value changing from undefined to a defined value, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://react.dev/link/controlled-components

Changing an uncontrolled input to be controlled

A form field started with no value and then got one, so React switched from letting the browser manage it to managing it from state.

You're importing a module that depends on `useState` into a React Server Component module. This API is only available in Client Components. To fix, mark the file (or its parent) with the `"use client"` directive. Learn more: https://nextjs.org/docs/app/api-reference/directives/use-client

You’re importing a component that needs useState

A Next.js Server Component used a browser-side React feature like useState, which only works in files marked as Client Components.

Rendered more hooks than during the previous render.

Rendered more hooks than during the previous render

A component called a different number of hooks than on its last render, usually because a hook sits after an early return or inside an if.

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

useNavigate() may be used only in the context of a <Router>

A component used React Router’s navigation outside the router, so it had no route information to work with.

JavaScript

Everyday runtime errors in the browser console.

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

Cannot read properties of undefined

The code asked for a property of a value that doesn’t exist yet, usually data that hasn’t loaded or a field the API didn’t return.

TypeError: data.map is not a function

X is not a function

The code called something that isn’t a function, most often .map on API data that came back as an object or a string instead of an array.

ReferenceError: useState is not defined

X is not defined

The code used a name JavaScript can’t find anywhere, usually because of a missing import, a typo, or a Node-only global like process in the browser.

Uncaught ReferenceError: process is not defined

process is not defined

Browser code used process, a Node.js global that browsers don’t have, usually to read an environment variable the Node.js way.

RangeError: Maximum call stack size exceeded

Maximum call stack size exceeded

A function kept calling itself, directly or through other functions, until JavaScript ran out of room to keep track of the calls.

TypeError: Assignment to constant variable.

Assignment to constant variable

The code tried to give a new value to a variable declared with const, which can only be set once.

APIs and network

Errors when the app talks to a server or an API.

Access to fetch at 'https://api.example.com/items' from origin 'http://localhost:5173' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

Blocked by CORS policy

The browser hid a response from another site because that server never said your site is allowed to read it.

TypeError: Failed to fetch

Failed to fetch

The browser never got a usable response: the server was unreachable, or the browser blocked the request or its reply.

SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON

Unexpected token '<', "<!DOCTYPE "... is not valid JSON

Your code expected JSON, but the server sent back an HTML page, usually a 404 page or your app’s own index.html.

GET http://localhost:3000/api/items net::ERR_CONNECTION_REFUSED

net::ERR_CONNECTION_REFUSED

Nothing was listening at that address and port, usually because the server isn’t running or the app is calling the wrong port.

SyntaxError: Unexpected end of JSON input

Unexpected end of JSON input

Your code tried to read JSON from text that was empty or cut off, so the parser ran out of input before the data was complete.

GET https://api.example.com/items 401 (Unauthorized)

401 Unauthorized

The server couldn’t confirm who was calling: the request had no credentials, or its API key, session, or token was wrong or expired.

GET https://api.example.com/items 403 (Forbidden)

403 Forbidden

The server knows who is calling and still refuses, because that user, key, or visitor lacks permission for this request.

POST https://my-app.com/api/checkout 500 (Internal Server Error)

500 Internal Server Error

The server’s code threw an error or crashed while handling the request, and the real error message is waiting in the server logs.

POST https://api.example.com/generate 429 (Too Many Requests)

429 Too Many Requests

The service is rate limiting you: too many requests arrived in a short time, so it refuses more until the limit resets.

Mixed Content: The page at 'https://my-app.com/' was loaded over HTTPS, but requested an insecure resource 'http://api.example.com/items'. This request has been blocked; the content must be served over HTTPS.

Mixed Content: requested an insecure resource

Your secure https page tried to load data or code over plain http, and the browser blocked that request to keep the page secure.

POST http://localhost:3000/api/upload 413 (Payload Too Large)

413 Payload Too Large

The request body, usually a file upload, was bigger than the server or host accepts, so it was rejected before your code could handle it.

Database

Postgres and Supabase errors when reading and saving data.

new row violates row-level security policy for table "todos"

New row violates row-level security policy

Postgres refused to save a row because no row-level security policy on that table lets the current user write it.

relation "todos" does not exist

Relation does not exist

The query names a table that Postgres can’t find in this database, usually because it was never created here or has a different name.

duplicate key value violates unique constraint "profiles_pkey"

Duplicate key value violates unique constraint

The app tried to save a row whose ID, email, or other unique value is already in the table, so Postgres rejected the copy.

column "user_id" does not exist

Column does not exist

A query names a column the table doesn’t have, often because of a migration that never ran, a camelCase name, or text in double quotes.

insert or update on table "todos" violates foreign key constraint "todos_user_id_fkey"

Insert or update on table violates foreign key constraint

A row points at a parent row that doesn’t exist, or something tried to delete a parent row that other rows still point at.

null value in column "user_id" of relation "todos" violates not-null constraint

Null value in column violates not-null constraint

A save left a required column empty, and that column has no default value for Postgres to fill in.

sorry, too many clients already

Sorry, too many clients already

Every connection slot on the Postgres server is taken, usually by serverless functions that each open connections of their own.

permission denied for table todos

Permission denied for table

The database role making the request has no grant on that table, so Postgres refuses before row-level security even runs.

infinite recursion detected in policy for relation "profiles"

Infinite recursion detected in policy for relation

A row-level security policy reads from its own table, so checking the policy runs the same policy again, without end.

Cannot coerce the result to a single JSON object

Cannot coerce the result to a single JSON object

A Supabase query asked for exactly one row with single(), but its filter matched no rows or more than one.

Could not find the 'avatar_url' column of 'profiles' in the schema cache

Could not find the column in the schema cache

An insert or update sent a field that Supabase’s API doesn’t know as a column of that table, so it refused the whole write.

Sign-in

Errors when people sign up, sign in, or stay signed in.

Access blocked: This app's request is invalid You can't sign in because this app sent an invalid request. You can try again later, or contact the developer about this issue. Error 400: redirect_uri_mismatch

Error 400: redirect_uri_mismatch

Google stopped the sign-in because the return address your app sent isn’t on the OAuth client’s list of approved redirect URIs.

JWT expired

JWT expired

A request carried a sign-in token past its expiry time, usually because code saved the token once instead of using the refreshed one.

AuthApiError: Invalid login credentials

Invalid login credentials

Supabase couldn’t match that email and password to an account that signs in with a password, and it deliberately doesn’t say which part was wrong.

AuthApiError: Email not confirmed

Email not confirmed

The password was right, but the person hasn’t clicked the confirmation link Supabase emailed at sign-up, so sign-in is blocked.

AuthSessionMissingError: Auth session missing!

AuthSessionMissingError: Auth session missing

A Supabase auth call needed a signed-in user, but the client making it had no session, often because it runs on the server without cookies.

AuthApiError: email rate limit exceeded

Email rate limit exceeded

Supabase stopped sending sign-up, magic link, or reset emails because the project hit its hourly email limit, which is tiny with the built-in sender.

Install and build

Errors from npm, TypeScript, and the dev server.

Error: Cannot find module 'express' Require stack: - /Users/me/my-app/server.js

Cannot find module

Node tried to load a package or file that isn’t where the code says it is, usually because it was never installed or the path is wrong.

src/App.tsx:3:20 - error TS2307: Cannot find module '@/components/Header' or its corresponding type declarations.

Cannot find module or its corresponding type declarations

TypeScript couldn’t match an import to a file or package it understands, so the build fails even when the app runs fine in the browser.

SyntaxError: Cannot use import statement outside a module

Cannot use import statement outside a module

A file written with import syntax was loaded as an old-style script or CommonJS file, so loading stopped at the first import line.

./src/app/page.tsx:2:1 Module not found: Can't resolve '@/components/Header'

Module not found: Can't resolve

The bundler followed an import to a file or package that doesn’t exist under that name, so it couldn’t build the page.

[plugin:vite:import-analysis] Failed to resolve import "./components/Header" from "src/App.tsx". Does the file exist?

Failed to resolve import

Vite couldn’t find the file or package an import points to, so it can’t serve or build the page until the import matches something real.

npm error code ERESOLVE npm error ERESOLVE unable to resolve dependency tree npm error npm error While resolving: my-app@0.1.0 npm error Found: react@19.2.0 npm error node_modules/react npm error react@"^19.2.0" from the root project npm error npm error Could not resolve dependency: npm error peer react@"^16.8.5 || ^17.0.0 || ^18.0.0" from react-beautiful-dnd@13.1.1 npm error node_modules/react-beautiful-dnd npm error react-beautiful-dnd@"^13.1.1" from the root project npm error npm error Fix the upstream dependency conflict, or retry npm error this command with --force or --legacy-peer-deps npm error to accept an incorrect (and potentially broken) dependency resolution.

ERESOLVE unable to resolve dependency tree

npm stopped installing because a package only supports a different version of something your project already uses, most often React.

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory

JavaScript heap out of memory

Node used up all the memory it’s allowed and crashed, usually during a large build or in code that keeps holding on to more and more data.

Error: listen EADDRINUSE: address already in use :::3000

EADDRINUSE: address already in use

Another program is already listening on the port your server wants, often an old copy of the same dev server that never stopped.

src/App.tsx:14:22 - error TS2339: Property 'title' does not exist on type 'Todo'.

Property does not exist on type

TypeScript can’t find that field on the type it has for this value, either because the type is wrong or because the value might not have it.

src/lib/stripe.ts:4:7 - error TS2322: Type 'string | undefined' is not assignable to type 'string'. Type 'undefined' is not assignable to type 'string'.

Type is not assignable to type

A value’s type doesn’t match what the variable, prop, or function expects, often because the value might be missing or is the wrong kind.

> my-app@0.0.0 dev > vite sh: vite: command not found

vite: command not found

The shell couldn’t find the vite program, almost always because the project’s packages aren’t installed or the command ran in the wrong folder.

Deploy and domains

Errors after publishing, from hosting, DNS, and HTTPS.

This page isn’t working my-app.com redirected you too many times. Try deleting your cookies. ERR_TOO_MANY_REDIRECTS

ERR_TOO_MANY_REDIRECTS

The site keeps redirecting the browser in a circle, usually between HTTP and HTTPS or between two domains, so the browser stops trying.

This site can’t be reached Check if there is a typo in my-app.com. If spelling is correct, try running Network Diagnostics. DNS_PROBE_FINISHED_NXDOMAIN

DNS_PROBE_FINISHED_NXDOMAIN

The browser asked DNS where your domain lives and was told the name doesn’t exist, usually because a record is missing or still spreading.

Your connection is not private Attackers might be trying to steal your information from my-app.com (for example, passwords, messages, or credit cards). Learn more about this warning NET::ERR_CERT_COMMON_NAME_INVALID

NET::ERR_CERT_COMMON_NAME_INVALID

The site’s security certificate was issued for a different domain name, so the browser can’t confirm it’s really your site.

Connection timed out Error code 522 Visit cloudflare.com for more information. 2026-10-27 18:42:10 UTC

Error 522: Connection timed out

Cloudflare couldn’t open a connection to the server behind your site in time, so it showed its own error page in place of your app.

404: NOT_FOUND This page doesn’t exist It may have been moved, removed, or never existed. 404 NOT_FOUND sfo1::ntg68-1793091406762-e6fdeff1eb27

404 on page refresh

Your single-page app works from the home page, but the host has no file for deeper URLs, so reloads and shared links hit a 404.

Failed to load module script: Expected a JavaScript-or-Wasm module script but the server responded with a MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.

Failed to load module script

The browser asked for your app’s JavaScript and got an HTML page back, so it refused to run it and the page stayed blank.

TypeError: Failed to fetch dynamically imported module: https://my-app.com/assets/Settings-B7x2kQ9d.js

Failed to fetch dynamically imported module

The browser asked for a piece of your app that no longer exists, usually because a new deploy replaced it while the page was open.

Error: Command "npm run build" exited with 1

Command "npm run build" exited with 1

Your build script failed on the host. This line only reports the failure; the actual error is printed earlier in the build log.

Error 1101 Ray ID: 8d4f1c2b9a7e3f10 • 2026-10-27 18:42:10 UTC Worker threw exception

Error 1101: Worker threw exception

Your Cloudflare Worker hit a JavaScript error while handling the request, so Cloudflare showed its error page in place of a response.

504: GATEWAY_TIMEOUT Code: FUNCTION_INVOCATION_TIMEOUT ID: iad1::q8n2v-1793091406762-4b1e2f9a7c3d

FUNCTION_INVOCATION_TIMEOUT

A Vercel Function ran past its time limit, so Vercel stopped it and returned a 504 in place of your response.

Uncaught Error: supabaseUrl is required.

supabaseUrl is required

The deployed app created its Supabase client with an empty URL, because the environment variable holding it never made it into the build.

Payments

Stripe errors from checkout and webhooks.

StripeSignatureVerificationError: No signatures found matching the expected signature for payload. Are you passing the raw request body you received from Stripe? If a webhook request is being forwarded by a third-party tool, ensure that the exact request body, including JSON formatting and new line style, is preserved. Learn more about webhook signing and explore webhook integration examples for various frameworks at https://docs.stripe.com/webhooks/signature

No signatures found matching the expected signature

Your webhook code couldn’t verify that a Stripe event is genuine, usually because the body was parsed before the check or the secret is wrong.

StripeAuthenticationError: Invalid API Key provided: sk_test_********************4242

Invalid API Key provided

Stripe rejected the request because the API key it received doesn’t match any active key, often a placeholder, a typo, or a deleted key.

StripeInvalidRequestError: No such price: 'price_1Q2w3E4r5T6y7U8i9O0pAbCd'

No such price

Stripe couldn’t find the price ID your code sent, because it belongs to the other mode, another account or sandbox, or isn’t a price ID at all.

AI APIs

Errors from OpenAI, Anthropic, and other model APIs.

RateLimitError: 429 You exceeded your current quota, please check your plan and billing details. For more information on this error, read the docs: https://platform.openai.com/docs/guides/error-codes/api-errors.

You exceeded your current quota

OpenAI refused the request because the account or project behind the API key is out of credit or has reached a spending limit.

AuthenticationError: 401 Incorrect API key provided: sk-proj-************************************************bb0A. You can find your API key at https://platform.openai.com/account/api-keys.

Incorrect API key provided

The AI API rejected the key your code sent: it has a typo, was revoked, or isn’t the key you think the app is using.

BadRequestError: 400 Your input exceeds the context window of this model. Please adjust your input and try again.

Context length exceeded

The text sent to the model, including chat history, documents, and tool results, is more than the model can read in one request.

InternalServerError: 529 {"type":"error","error":{"type":"overloaded_error","message":"Overloaded"},"request_id":"req_011CSHoEeqs5C35K2UUqR7Fy"}

Anthropic API 529 overloaded_error

Anthropic’s API had more traffic than it could serve at that moment, so it turned your request away even though the request was fine.

OpenAIError: It looks like you're running in a browser-like environment. This is disabled by default, as it risks exposing your secret API credentials to attackers. If you understand the risks and have appropriate mitigations in place, you can set the `dangerouslyAllowBrowser` option to `true`, e.g., new OpenAI({ apiKey, dangerouslyAllowBrowser: true }); https://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety

It looks like you're running in a browser-like environment

The AI SDK refused to run in the browser, because your secret API key would be visible to anyone who opens the page.

Git and GitHub

Errors when saving, pushing, and merging code.

To https://github.com/acme/my-app.git ! [rejected] main -> main (fetch first) error: failed to push some refs to 'https://github.com/acme/my-app.git' hint: Updates were rejected because the remote contains work that you do not hint: have locally. This is usually caused by another repository pushing to hint: the same ref. If you want to integrate the remote changes, use hint: 'git pull' before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details.

Failed to push some refs

GitHub has commits your copy doesn’t, so git refused to overwrite them until you bring those changes in.

fatal: not a git repository (or any of the parent directories): .git

fatal: not a git repository

Git searched this folder and every folder above it and found no repository, so the command has nothing to work on.

Auto-merging src/App.tsx CONFLICT (content): Merge conflict in src/App.tsx Automatic merge failed; fix conflicts and then commit the result.

CONFLICT (content): Merge conflict

Both versions changed the same lines in different ways, and git needs you to decide what the file should say before it finishes.

remote: error: GH013: Repository rule violations found for refs/heads/main. remote: remote: - GITHUB PUSH PROTECTION remote: ————————————————————————————————————————— remote: Resolve the following violations before pushing again remote: remote: - Push cannot contain secrets remote: remote: remote: (?) Learn how to resolve a blocked push remote: https://docs.github.com/code-security/secret-scanning/working-with-secret-scanning-and-push-protection/working-with-push-protection-from-the-command-line#resolving-a-blocked-push remote: remote: remote: —— OpenAI API Key ———————————————————————————————————— remote: locations: remote: - commit: 3f9c2a1d8e7b6c5a4f3e2d1c0b9a8f7e6d5c4b3a remote: path: .env:2 remote: remote: (?) To push, remove secret from commit(s) or follow this URL to allow the secret. remote: https://github.com/acme/my-app/security/secret-scanning/unblock-secret/2pXk9vQmT4bL7nRw1sYc8ZfHj3e remote: To https://github.com/acme/my-app.git ! [remote rejected] main -> main (push declined due to repository rule violations) error: failed to push some refs to 'https://github.com/acme/my-app.git'

GH013: Push cannot contain secrets

GitHub found an API key or other secret in the commits you tried to push and blocked the whole push so the secret wouldn’t land in the repository.