Common problems in AI-built apps

Getting an error from your AI-generated code? We've seen it before. Find your issue below for causes, fixes, and when to get professional help.

AI coding tools are great at generating code that looks correct. But under real-world conditions, that code frequently breaks in predictable ways. Hydration mismatches, CORS errors, silent authentication failures, and misconfigured environment variables are some of the most common issues we encounter when auditing AI-built apps.

Each problem page below covers a specific error pattern. You will find a clear explanation of what causes the issue, step-by-step instructions to fix it, and guidance on when the problem is complex enough that professional help is the faster path. These are not hypothetical scenarios. They are drawn from real codebases generated by tools like Cursor, Lovable, Bolt, and Replit.

If you are seeing an error you do not fully understand, start here. Matching your error message to one of these patterns is usually the fastest way to get back on track.

Next.js Hydration Error

Hydration errors occur when the server-rendered HTML doesn't match what React expects on the client.

Next.js Dynamic Server Usage Error

Getting 'Dynamic server usage' errors when using cookies(), headers(), or searchParams in Next.

Next.js Build Fails

Build failures in Next.

Next.js Server Component Error

Server Component errors arise when you mix server and client paradigms incorrectly.

React White Screen

A white screen (or blank page) in React typically means the app crashed during rendering without a visible error.

React Infinite Loop

Infinite re-render loops happen when a component triggers a state update on every render, creating an endless cycle.

React Hooks Error

React enforces strict rules for hooks: they must be called at the top level of a function component, not inside loops, conditions, or nested functions.

React State Not Updating

State not updating is usually caused by stale closures, mutating state directly, or misunderstanding that setState is asynchronous.

Supabase RLS Denied

Row Level Security (RLS) blocks all access to tables by default when enabled.

Supabase Auth Session Missing

A missing auth session means getSession() or getUser() returns null when you expect an authenticated user.

Supabase Edge Function Returned Non-2xx Status

'Edge function returned a non-2xx status code' in Supabase? Usually it's CORS, Deno imports, or missing secrets.

Vercel Build Fails

Vercel builds fail for reasons that don't surface locally: missing environment variables, case-sensitive file paths, memory limits, or dependencies that require native compilation.

Vercel Serverless Function Timeout

Vercel serverless functions have execution time limits (10s on Hobby, 60s on Pro).

CORS Error

CORS errors occur when your frontend makes requests to a different origin (domain, port, or protocol) and the server doesn't include the correct Access-Control-Allow-Origin headers.

Environment Variables Not Loading

Environment variables showing as undefined is a common issue caused by missing .

Works Locally But Not in Production

The 'works on my machine' problem stems from differences between your local environment and production: missing env vars, different Node versions, file system case sensitivity, or build-time vs runtime behavior differences.

TypeScript Type Error

TypeScript type errors catch bugs at compile time but can be frustrating when types don't match runtime behavior.

Prisma Migration Error

Prisma migration errors occur when the migration SQL can't be applied to your database.

Docker Build Fails

Docker image builds fail due to incorrect Dockerfiles, missing dependencies, or platform mismatches.

Supabase Connection Pool Exhausted

Your app runs out of database connections, causing queries to hang or fail.

Next.js Metadata API Error

Next.

Next.js Middleware Error

Next.

Lovable App Broken After Update

Lovable platform updates can break your app without any changes on your side.

Base44 Export Not Working

Base44's export feature does not always produce a fully self-contained project.

API Keys Exposed in Client Bundle

If your API keys, database credentials, or third-party secrets are visible in the browser's developer tools or JavaScript bundle, they are compromised.

Supabase RLS Not Configured

If your Supabase tables do not have Row Level Security (RLS) enabled and configured, any user with your anon key can read, insert, update, or delete any row in those tables.

Environment Variables Exposed in Client Bundle

Environment variables prefixed with NEXT_PUBLIC_ (Next.

Don't see your error listed?

Send us the error message and your repo. We'll diagnose it and give you a fix quote within 24 hours.

Request a Quote