Error fix guides

The errors people building with AI tools hit most — explained in plain language, with a prompt that makes your coding agent fix them.

Fix Vite/Lovable environment variable exposure in browser builds

Variable is not defined in browser / Vite build didn't include it

Fix Supabase RLS "new row violates row-level security policy" (42501)

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

Fix "Failed to fetch" error

Error: failed to fetch

Fix Next.js 15+ async Request-time APIs

Next.js 15+ App Router page props are Promises

Fix CORS for Supabase Edge Functions with Lovable

Access to fetch at ... from origin ... has been blocked by CORS policy

Fix Claude Code / Cursor HTTP 413 Request Entity Too Large

HTTP 413 Request Entity Too Large

Fix Can't resolve '@/components/ui/button'

Module not found: Can't resolve '@/components/ui/button'

Fix Next.js "Hydration failed" mismatch error

Error: Hydration failed because the server rendered HTML didn't match the client

Fix CORS error: No Access-Control-Allow-Origin header

Access to fetch at 'https://api.example.com' from origin 'http://localhost:3000'

Fix "new row violates row-level security policy"

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

Fix 401 "invalid x-api-key" / "Incorrect API key provided"

401 Unauthorized: invalid x-api-key / Incorrect API key provided

Fix Cannot read properties of undefined (reading 'map')

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

Fix "ReferenceError: window is not defined" in Next.js

ReferenceError: window is not defined

Fix Next.js "Build failed because of TypeScript errors"

Type error: ... Build failed because of TypeScript errors (next build / vercel d

Fix EADDRINUSE: address already in use :::3000

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

Fix "@prisma/client did not initialize yet"

@prisma/client did not initialize yet. Please run "prisma generate" and try to i

Fix "Updates were rejected" (fetch first) on git push

! [rejected] main -> main (fetch first) error: failed to push some refs ... Upda

Fix Stripe webhook "No signatures found matching"

No signatures found matching the expected signature for payload. Are you passing

Fix useSearchParams() should be wrapped in Suspense

useSearchParams() should be wrapped in a suspense boundary at page "/". Read mor

Fix Supabase "Edge Function returned a non-2xx"

FunctionsHttpError: Edge Function returned a non-2xx status code

Fix "Failed to fetch" error in browser (CORS, localhost & more)

TypeError: Failed to fetch

Fix React "Too many re-renders" infinite loop

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

Fix Supabase "Invalid Refresh Token: Not Found"

AuthApiError: Invalid Refresh Token: Refresh Token Not Found

Fix Cannot read properties of null (reading 'X')

TypeError: Cannot read properties of null (reading 'X')

Fix "Maximum update depth exceeded" in React

Error: Maximum update depth exceeded. This can happen when a component repeatedl

Fix Vercel 504 FUNCTION_INVOCATION_TIMEOUT

504: GATEWAY_TIMEOUT Code: FUNCTION_INVOCATION_TIMEOUT · Vercel Runtime Timeout

Fix Supabase "Invalid login credentials" and "Email not confirmed"

AuthApiError: Invalid login credentials

Fix "Cross-Origin-Opener-Policy policy would block the window.closed call"

Cross-Origin-Opener-Policy policy would block the window.closed call.

Fix Next.js "Dynamic server usage" (couldn't be rendered statically)

Error: Dynamic server usage: Route /dashboard couldn't be rendered statically be

Fix Supabase "AuthSessionMissingError: Auth session missing!"

AuthSessionMissingError: Auth session missing!

Fix Vite "Failed to resolve import … Does the file exist?"

[plugin:vite:import-analysis] Failed to resolve import "./components/Navbar" fro

Fix Next.js "Module not found: Can't resolve 'fs'"

Module not found: Can't resolve 'fs'

Fix "trying to use tailwindcss directly as a PostCSS plugin"

It looks like you're trying to use `tailwindcss` directly as a PostCSS plugin. T

Fix React "Invalid hook call": causes and fixes

Invalid hook call. Hooks can only be called inside of the body of a function com

Fix Next.js 16 "middleware file convention is deprecated" (use proxy)

⚠ The "middleware" file convention is deprecated. Please use "proxy" instead.

Fix Claude Code "response exceeded the 32000 output token maximum"

API Error: Claude's response exceeded the 32000 output token maximum. To configu

Fix Supabase "Could not find the table … in the schema cache" (PGRST205)

Could not find the table 'public.profiles' in the schema cache

Fix React "Rendered more hooks than during the previous render"

Error: Rendered more hooks than during the previous render.

Fix Supabase "JWT expired" (PGRST303, 401)

{"code":"PGRST303","details":null,"hint":null,"message":"JWT expired"}

Fix Netlify build failure due to missing environment variable

Netlify build fails because required environment variable not set (e.g. undefine

Fix Supabase "permission denied for table" (42501) - missing GRANT

permission denied for table "profiles" (code 42501)

Fix Next.js 16 runtime config error in proxy file

Build error about runtime config being rejected in proxy.ts (Next.js 16). The pr

Fix Claude Code 400 about unpaired tool_use and tool_result blocks

Claude Code returns a 400 error when tool_use blocks aren't followed by their to

Fix React "Cannot update a component while rendering a different component"

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

Fix Claude Code "Invalid signature in thinking block" (400)

API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message"

Fix Claude Code "thinking blocks cannot be modified" (400)

API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message"

Fix Supabase "infinite recursion detected in policy" error

infinite recursion detected in policy for relation "profiles"

Fix npm ERESOLVE unable to resolve dependency tree

npm ERR! ERESOLVE unable to resolve dependency tree

Fix Supabase Storage "permission denied" and 403 errors

permission denied for table storage.objects

Fix Supabase "Invalid API key" and 401 errors

{"message":"Invalid API key","hint":"Double check your Supabase anon or service_

Fix "headers was called outside a request scope" in Next.js App Router

`headers` was called outside a request scope. Read more: https://nextjs.org/docs

Fix Firefox "NetworkError when attempting to fetch resource"

TypeError: NetworkError when attempting to fetch resource.

Fix Next.js environment variables missing at build time

Next.js build fails because a required environment variable is undefined or not

Fix React "Each child in a list should have a unique key" warning

Warning: Each child in a list should have a unique "key" prop.

Fix Supabase Auth "email rate limit exceeded" (429)

email rate limit exceeded (code: over_email_send_rate_limit, HTTP 429)

Fix Next.js hydration: Date.now() in render

Error: Hydration failed because the server rendered HTML didn't match the client

Fix Supabase 42501 permission denied for new tables

42501: permission denied for table "tablename"

Fix Cursor OpenAI rate limit exceeded

Rate limit exceeded for your OpenAI key.

Fix Lovable app not loading / 'Something went wrong'

Something went wrong on our end. You can try refreshing or head back home.

Fix Netlify build failures

Netlify build failed / deployment error

Fix Next.js middleware deprecation - rename middleware.ts to proxy.ts

Next.js middleware is deprecated; use proxy.ts instead

Fix Next.js 16 proxy files not allowing runtime config

Next.js 16 proxy files do not allow a runtime configuration