The most common errors and their fixes

Errors people hit most often building with Lovable, Bolt, Cursor, Replit, v0 and Windsurf, ranked by how often they come up. Each one has a fix prompt you can copy.

60 errors, sorted by how common they are
#1 most commonruntime/UILovableBolt.newCursorReplitv0Windsurf

Blank white (or black) screen, nothing loads

The preview or published site shows a completely blank white/black page. Console often shows: Uncaught TypeError / Uncaught ReferenceError ...

Your app crashed while it was starting up, so the browser has nothing to draw. It's almost always one specific error hiding in the browser console, and that error names the exact file that broke.

How to fix it →
#2 most commondatabaseLovableBolt.newCursorReplitv0Windsurf

new row violates row-level security policy for table

new row violates row-level security policy for table "profiles" (code 42501, 403 Forbidden)

Your database has a security guard (Row Level Security) that checks every save. There's no rule allowing this user to add or change this row, so the guard blocks it.

How to fix it →
#3 most commonbuildLovableBolt.newCursorReplitWindsurf

Failed to resolve import "..." from "src/...". Does the file exist?

[plugin:vite:import-analysis] Failed to resolve import "@/components/ui/button" from "src/pages/Index.tsx". Does the file exist?

A page is trying to load another file or package that isn't there. Either the file was renamed or deleted (often by the AI itself), the path is spelled differently, or a package was never installed.

How to fix it →
#6 most commonruntime/UILovableBolt.newCursorReplitv0Windsurf

TypeError: Cannot read properties of undefined (or null)

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

The code tried to use a piece of data before it existed, like reading a list before it finished loading from the database. It's like opening a box that hasn't been delivered yet.

How to fix it →
#7 most commondeployLovableBolt.newCursorReplitv0Windsurf

404 / Page not found when refreshing or opening a link on the live site

404: NOT_FOUND Code: NOT_FOUND (Vercel) / Page not found: Looks like you've followed a broken link (Netlify). Only on routes like /dashboard after refresh.

Your app handles its pages inside the browser, but when you refresh, the hosting service looks for a real file called /dashboard, can't find it, and shows 404. It needs one rule saying 'always send people to the app'.

How to fix it →
#8 most commonruntime/UILovableBolt.newCursorReplitv0Windsurf

Blocked by CORS policy (No 'Access-Control-Allow-Origin' header)

Access to fetch at 'https://api...' from origin 'https://myapp...' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

Browsers only let your site talk to another server if that server says 'yes, that website is allowed'. The server you're calling didn't say that, so the browser blocked the request.

How to fix it →
#9 most commonauthLovableBolt.newCursorReplitv0Windsurf

Login / magic link / email confirmation redirects to localhost

After clicking the confirmation or magic link: This site can't be reached. localhost refused to connect (ERR_CONNECTION_REFUSED)

Your login system still thinks your app lives on your own computer (localhost), so it sends users there after they click the email link. It needs your real website address.

How to fix it →
#10 most commondatabaseLovableBolt.newCursorWindsurf

Failed to send a request to the Edge Function / non-2xx status code

FunctionsFetchError: Failed to send a request to the Edge Function / FunctionsHttpError: Edge Function returned a non-2xx status code

Your app's small server function on Supabase either couldn't be reached (often a CORS or not-deployed issue) or ran and crashed. The real message is in the function's logs.

How to fix it →
#11 most commondatabaseLovableBolt.newCursorReplitv0Windsurf

permission denied for table (Supabase 42501, missing GRANT)

{"code":"42501","message":"permission denied for table todos","hint":"Grant the required privileges to the current role with: GRANT SELECT ON public.todos TO anon;"}

Your app's users (the 'anon' and 'authenticated' roles) haven't been given access to this table at all, so the database refuses before it even looks at your security rules. Supabase no longer gives new tables that access automatically: it's the default for projects created since May 30, 2026 and applies to all existing projects from October 30, 2026. Tables that already existed keep working; newly created ones need an explicit GRANT.

How to fix it →
#14 most commondeployLovableBolt.newCursorReplitv0Windsurf

Deploy fails: Command "npm run build" exited with 1

Error: Command "npm run build" exited with 1 / Build failed due to a user error: Build script returned non-zero exit code: 2

The hosting service tried to package your app and hit an error partway through. The real reason is a few lines above this message in the build log.

How to fix it →
#15 most commonenv/configLovableBolt.newCursorReplitv0Windsurf

Error: supabaseUrl is required (or supabaseKey is required)

Uncaught Error: supabaseUrl is required. / supabaseKey is required.

Your app tried to connect to your Supabase database but the address or key was empty. The settings exist in one place (like your builder) but not where the app is actually running.

How to fix it →
#16 most commonbuildLovableBolt.newCursorReplitv0Windsurf

TypeScript errors break the build (error TS2322, TS2339 ...)

error TS2322: Type 'string | undefined' is not assignable to type 'string'. / error TS2339: Property 'x' does not exist on type 'Y'. / Type error: ... (next build)

TypeScript is a spell-checker for code. It found places where data doesn't match what the code expects, and a strict build refuses to finish until those are fixed.

How to fix it →
#18 most commonruntime/UILovableBolt.newCursorReplitv0Windsurf

TypeError: Failed to fetch / NetworkError

TypeError: Failed to fetch / NetworkError when attempting to fetch resource / net::ERR_NAME_NOT_RESOLVED

Your app tried to call a server and never got an answer. The address could be wrong, the server could be off or paused, or the browser blocked the request (often a CORS problem).

How to fix it →
#20 most commonruntime/UIv0CursorWindsurfBolt.newReplit

Hydration failed: server HTML didn't match the client

Error: Hydration failed because the initial UI does not match what was rendered on the server. / Text content does not match server-rendered HTML.

Next.js builds your page twice: once on the server and once in the browser. The two versions came out different (often because of dates, random numbers, or browser-only data), so React complains.

How to fix it →
#21 most commonpaymentsLovableBolt.newCursorReplitv0Windsurf

Stripe: No signatures found matching the expected signature for payload

StripeSignatureVerificationError: No signatures found matching the expected signature for payload. Are you passing the raw request body you received from Stripe?

Stripe signs every payment notification so your app can trust it. The check failed because either the secret is the wrong one, or your app changed the message before checking it.

How to fix it →
#26 most commonruntime/UILovableBolt.newCursorReplitv0Windsurf

Too many re-renders / Maximum update depth exceeded

Error: Too many re-renders. React limits the number of renders to prevent an infinite loop. / Maximum update depth exceeded.

A part of your page keeps changing itself, which makes it redraw, which makes it change itself again, forever. React stops it to prevent your browser from freezing.

How to fix it →
#27 most commondependenciesBolt.newReplitCursorWindsurfLovable

sh: vite: command not found (exit code 127)

sh: 1: vite: not found / jsh: command not found: vite / Command failed with exit code 127: npm run build

The tool your app needs to start or build isn't installed in this environment. Usually the install step never finished or a package went missing from the dependency list.

How to fix it →
#28 most commondatabaseLovableBolt.newCursorWindsurfv0

infinite recursion detected in policy for relation

infinite recursion detected in policy for relation "profiles" (code 42P17)

One of your database security rules checks the same table it's protecting, which asks the rule again, forever. It's usually an 'is this user an admin?' check.

How to fix it →
#29 most commonbuildLovableBolt.newCursorWindsurfv0

The requested module does not provide an export named '...'

Uncaught SyntaxError: The requested module '/src/lib/api.ts' does not provide an export named 'fetchUsers' / Module '"x"' has no exported member 'Y'.

Your code asks a file for something by name, but that file doesn't offer anything with that name. Often the AI renamed a function or invented one that a package doesn't actually have.

How to fix it →
#30 most commonruntime/UIv0CursorWindsurfBolt.new

ReferenceError: window / document / localStorage is not defined

ReferenceError: window is not defined / localStorage is not defined / document is not defined

Some of your code expects to run in a web browser, but Next.js also runs it on the server, where there is no browser window. The code needs to wait until it's actually in the browser.

How to fix it →
#31 most commonruntime/UIv0CursorWindsurfBolt.new

You're importing a component that needs useState (add "use client")

You're importing a component that needs useState. This React hook only works in a client component. To fix, mark the file (or its parent) with the "use client" directive.

Next.js splits code into server parts and browser parts. A piece that needs to react to clicks or remember things was placed on the server side without being marked as a browser component.

How to fix it →
#32 most commonpaymentsLovableBolt.newCursorWindsurfv0

Payment succeeds but the app doesn't unlock / update the user

User pays in Stripe Checkout, returns to the success page, but their account still shows as free / subscription not updated.

Stripe took the money, but your app never heard about it. Apps should learn about payments from a Stripe webhook (a message Stripe sends to your server), not just from the success page.

How to fix it →
#34 most commonauthLovableBolt.newCursorWindsurfv0

Auth session missing / JWT expired / Invalid Refresh Token

AuthSessionMissingError: Auth session missing! / JWT expired / AuthApiError: Invalid Refresh Token: Refresh Token Not Found

The app forgot who's logged in, or the login pass it was holding expired and couldn't be renewed. Users suddenly appear logged out or requests fail.

How to fix it →
#35 most commondatabaseCursorWindsurfBolt.newReplitv0

FirebaseError: Missing or insufficient permissions

FirebaseError: [code=permission-denied]: Missing or insufficient permissions.

Your Firebase database's security rules don't allow this read or write. Either the rules are too strict, the user isn't logged in yet, or the query asks for more than the rules allow.

How to fix it →
#36 most commondatabaseLovableBolt.newCursorReplitv0Windsurf

duplicate key value violates unique constraint

duplicate key value violates unique constraint "profiles_pkey" (23505)

You tried to save something that must be unique (like a user's profile or an email) but it's already there. Often the app creates the same profile twice.

How to fix it →
#37 most commonauthLovableBolt.newCursorReplitv0Windsurf

Google sign-in: Error 400 redirect_uri_mismatch

Error 400: redirect_uri_mismatch. You can't sign in to this app because it doesn't comply with Google's OAuth 2.0 policy.

Google only sends users back to addresses you've pre-approved. The address your app (or Supabase/Firebase) uses isn't on Google's approved list.

How to fix it →
#38 most commonAI-loopLovableBolt.newCursorReplitv0Windsurf

AI forgets the project / conversation too long / context limit

This conversation is too long / maximum context length exceeded / the AI forgets earlier decisions and re-creates files.

AI assistants can only hold a limited amount of your project and chat in their head at once. In long sessions they forget earlier details and start contradicting themselves.

How to fix it →
#39 most commonruntime/UILovableBolt.newCursorv0Windsurf

Objects are not valid as a React child

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

The page tried to display a whole bundle of data (an object) as if it were plain text. It needs to be told which specific field to show, like the name instead of the whole customer record.

How to fix it →
#40 most commonruntime/UILovableBolt.newCursorv0Windsurf

Element type is invalid: expected a string ... but got: undefined

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.

The page tried to use a component that doesn't exist under that name. Usually a file was renamed, or a component is imported with the wrong style of import.

How to fix it →
#41 most commonpaymentsLovableBolt.newCursorReplitv0Windsurf

Stripe: No such price / No such customer (resource_missing)

StripeInvalidRequestError: No such price: 'price_123' / No such customer: 'cus_...'; a similar object exists in test mode, but a live mode key was used to make this request.

Your app refers to a price or customer that Stripe can't find with the key you're using. Usually you mixed test-mode IDs with live-mode keys (or vice versa), or the AI made up a placeholder ID.

How to fix it →
#42 most commonbuildBolt.newCursorv0WindsurfLovable

Build fails on the host because of lint warnings ("Treating warnings as errors")

Treating warnings as errors because process.env.CI = true. Most CI servers set it automatically. / Failed to compile. ESLint: 'x' is assigned a value but never used.

Your hosting service checks code-quality warnings more strictly than your preview does. Small issues like unused variables are being treated as fatal errors during the live build.

How to fix it →
#43 most commonruntime/UILovableBolt.newCursorReplitv0Windsurf

Tailwind / styles not applying (page looks unstyled)

Page renders but looks like plain HTML with no styling. Sometimes: Unknown at rule @tailwind / Cannot apply unknown utility class

Your design styles aren't being loaded, so the page falls back to plain browser defaults. Usually the style file isn't connected, or the Tailwind setup doesn't match the version installed.

How to fix it →
#44 most commonenv/configLovableBolt.newCursorReplitv0Windsurf

OpenAI / AI API: Incorrect API key (401) or quota exceeded (429)

401 Incorrect API key provided / 429 You exceeded your current quota, please check your plan and billing details / insufficient_quota / rate_limit_exceeded

The AI service your app calls either doesn't recognize your key, or your account has run out of credit or is sending too many requests too fast.

How to fix it →
#45 most commonenv/configLovableBolt.newCursorReplitv0Windsurf

Invalid API key / No API key found in request (Supabase)

{"message":"Invalid API key","hint":"Double check your Supabase `anon` or `service_role` API key."} / No API key found in request

The key your app uses to talk to Supabase is wrong, belongs to a different project, or is missing. Often keys were copied from an old project or rotated.

How to fix it →
#47 most commondeployLovableBolt.newCursorReplitv0Windsurf

Images or files missing after deploy (404 on .png/.jpg/.svg)

GET https://myapp.com/src/assets/logo.png 404 (Not Found) / Failed to load resource: the server responded with a status of 404

Your images worked in preview but the live site can't find them. The code points to where the file sits in your project folder, not where it ends up after the app is packaged.

How to fix it →
#49 most commonruntime/UILovableBolt.newCursorv0Windsurf

Invalid hook call / Rendered more hooks than during the previous render

Invalid hook call. Hooks can only be called inside of the body of a function component. / Rendered more hooks than during the previous render.

React has strict rules about where special functions called 'hooks' (useState, useEffect, etc.) can be used. One of them is being used in the wrong place, like inside an if-statement, or two copies of React got installed.

How to fix it →
#53 most commondatabaseLovableBolt.newCursorWindsurf

Storage: Bucket not found / upload blocked

StorageApiError: Bucket not found / 403 Unauthorized new row violates row-level security policy (storage upload)

Your app tries to upload or show files from a storage folder ('bucket') that either doesn't exist under that name or doesn't allow this user to upload.

How to fix it →
#54 most commondatabaseLovableBolt.newCursorWindsurfv0

insert or update violates foreign key constraint

insert or update on table "orders" violates foreign key constraint "orders_user_id_fkey" (23503)

You tried to link a record to something that doesn't exist, like an order for a customer who isn't in the customers table yet.

How to fix it →
#55 most commonauthCursorWindsurfBolt.newReplitv0

Firebase: auth/unauthorized-domain

FirebaseError: Firebase: Error (auth/unauthorized-domain). This domain is not authorized for OAuth operations for your Firebase project.

Firebase only allows sign-in from websites you've listed. Your live site's address isn't on that list yet.

How to fix it →
#56 most commondependenciesReplitCursorWindsurfBolt.newv0

Node.js version mismatch (Unsupported engine / requires Node >= 18)

npm WARN EBADENGINE Unsupported engine / The engine "node" is incompatible with this module. Expected version ">=18.17.0". / You are using Node.js 16.x. Next.js requires Node.js >= 18.

Your app needs a newer version of Node (the engine that runs JavaScript on servers) than the one your computer or host is using.

How to fix it →
#57 most commondependenciesBolt.newReplitCursorWindsurf

npm ERR! enoent Could not read package.json

npm ERR! code ENOENT npm ERR! syscall open npm ERR! path /home/project/package.json npm ERR! enoent Could not read package.json

The terminal is running in a folder that doesn't contain your project's main settings file. Either you're in the wrong folder or the file never got created.

How to fix it →
#58 most commonruntime/UILovableBolt.newCursorReplitv0Windsurf

Mixed Content: page loaded over HTTPS requested an insecure resource

Mixed Content: The page at 'https://...' was loaded over HTTPS, but requested an insecure resource 'http://...'. This request has been blocked.

Your live site is secure (https) but is trying to load something from an insecure (http) address, and browsers block that. Often it's a leftover link to your local computer or an old API address.

How to fix it →
#59 most commonenv/configCursorWindsurfBolt.newReplitv0

Firebase: auth/invalid-api-key or api-key-not-valid

FirebaseError: Firebase: Error (auth/invalid-api-key). / auth/api-key-not-valid.-please-pass-a-valid-api-key.

Your app's Firebase settings are missing or wrong, usually because the config values didn't load from environment variables on the live site.

How to fix it →