Platform

Cursor fixes

Production errors in apps written with Cursor, from env vars to server crashes.

30 fixes, most common first.

  1. Rank 1. Supabase login redirects to localhost:3000 after deploy

    Login or email confirm sends users to localhost:3000 on your live site? Change Supabase's Site URL and add your domain to Redirect URLs.

  2. Rank 2. Invalid API key (Supabase)

    Supabase says "Invalid API key" on your live site? Usually the key or project URL env var is missing, mistyped, or from another project.

  3. Rank 3. Environment variables are undefined in production

    Works locally but env vars are undefined once deployed? Add them to your host, use the VITE_ or NEXT_PUBLIC_ prefix for browser code, then redeploy.

  4. Rank 4. Supabase returns an empty array [] but the table has data

    Your Supabase query returns [] with no error even though rows exist? Row Level Security is on with no policy allowing the read.

  5. Rank 5. new row violates row-level security policy for table

    Saving data fails with "new row violates row-level security policy"? Add an INSERT policy with a WITH CHECK rule and send the right user_id.

  6. Rank 6. Webhook signature verification failed. No signatures found matching the expected signature for payload

    Stripe webhook fails signature check? Usually the wrong whsec_ secret or your framework changed the raw request body. Here's the fix.

  7. Rank 8. Blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present

    "Blocked by CORS policy" on your live site? The server you call must allow your domain. How to fix it for APIs you own and ones you don't.

  8. Rank 9. Supabase Edge Function CORS error: Response to preflight request doesn't pass access control check

    Calling a Supabase Edge Function from the browser fails with a CORS/preflight error? Handle OPTIONS and return corsHeaders on every response.

  9. Rank 12. Module not found: Can't resolve (build works locally, fails on Vercel)

    Vercel build fails with "Module not found: Can't resolve" but works on your Mac/PC? Usually filename casing. How to find and fix it.

  10. Rank 14. Error 400: redirect_uri_mismatch (Sign in with Google)

    Google sign-in shows "Error 400: redirect_uri_mismatch"? The callback URL in Google Cloud must exactly match the one your app or Supabase uses.

  11. Rank 15. email rate limit exceeded (Supabase Auth)

    Supabase says "email rate limit exceeded" or sign-up emails stop? The built-in mailer allows only 2 emails an hour. Set up custom SMTP.

  12. Rank 17. Supabase service_role or secret key exposed in front-end code

    Is your Supabase service_role or sb_secret key in your browser code? Anyone can read it and bypass all security. How to rotate and fix it.

  13. Rank 18. infinite recursion detected in policy for relation

    Supabase error 42P17 "infinite recursion detected in policy for relation"? Two RLS policies check each other. Break the loop with a function.

  14. Rank 19. permission denied for table (Supabase error 42501)

    Supabase "permission denied for table"? The role lacks a GRANT on the table, which is checked before RLS. Add the grant, then a policy.

  15. Rank 20. Supabase Storage upload fails: new row violates row-level security policy

    Image/file upload to Supabase Storage fails with an RLS error? Add policies on storage.objects for INSERT (plus SELECT/UPDATE for upsert).

  16. Rank 21. Vercel FUNCTION_INVOCATION_TIMEOUT (504) on API routes or AI calls

    Vercel API route times out with 504 FUNCTION_INVOCATION_TIMEOUT? Common with slow AI calls. Raise maxDuration, stream, or move work to background.

  17. Rank 22. 500: INTERNAL_SERVER_ERROR / FUNCTION_INVOCATION_FAILED on Vercel

    Live site shows 500 FUNCTION_INVOCATION_FAILED but works locally? Your server code crashed. Read the runtime logs, then check env vars.

  18. Rank 23. too many connections / remaining connection slots are reserved (Supabase + serverless)

    Database errors like "too many connections" after deploying to Vercel? Use Supabase's transaction pooler (port 6543) for serverless functions.

  19. Rank 24. Hydration failed because the server rendered HTML didn't match the client

    Next.js "Hydration failed" error? The server and browser drew different HTML. Fix nesting, window/localStorage use and dates.

  20. Rank 25. Mixed Content: the page was loaded over HTTPS but requested an insecure resource

    Browser blocks requests with a "Mixed Content" warning on your HTTPS site? Change every http:// URL your app calls to https://.

  21. Rank 26. Vercel custom domain shows "Invalid Configuration"

    Added your domain to Vercel and it says Invalid Configuration? Set the DNS records Vercel shows at your registrar and wait for DNS.

  22. Rank 29. Stripe error: No such price / No such customer (resource_missing)

    Stripe says "No such price" or "No such customer" in production? You're mixing test and live keys or IDs. Match them.

  23. Rank 30. OpenAI API 429: You exceeded your current quota / rate limit reached

    Your app's AI feature fails with OpenAI 429? Either your credits ran out or you're sending requests too fast. How to tell which and fix it.

  24. Rank 31. Invalid JWT after switching to sb_publishable or sb_secret keys

    The app broke after Supabase's new sb_publishable or sb_secret keys? Legacy keys can stay on until you swap them. Don't send the new keys as a Bearer JWT.

  25. Rank 32. Build failed: npm ERR! ERESOLVE

    Vercel stops on npm ERR! ERESOLVE unable to resolve dependency tree? npm is refusing a peer dependency clash. Fix the versions, or override the install command on purpose.

  26. Rank 33. ReferenceError: window is not defined

    Next.js crashes with window is not defined? The page is rendered on the server, where window does not exist. Read it after the component mounts.

  27. Rank 34. Supabase error: JWT expired

    API calls fail with JWT expired? The Supabase access token is meant to be short-lived. Refresh the session once, and don't refresh it twice at the same time.

  28. Rank 36. TypeError: Failed to fetch (only in production)

    The live site says Failed to fetch, but the preview worked? The browser could not open the connection. Check the URL, HTTPS, and the console, not the HTTP status.

  29. Rank 39. Prisma on Vercel: query engine not found

    Vercel runs the app and Prisma can't find its query engine? The Rust engine file was left out of the serverless bundle, or Prisma Client was generated for the wrong machine.

  30. Rank 40. Supabase error: Email address not authorized

    Sign-up tells the user Email address not authorized? The built-in mailer only sends to your Supabase organization. Custom SMTP sends to everyone else.

All platforms

Can't fix it? Get help.

If the steps didn't clear the error, send what the screen says. A person can take a look. This is a request for a paid fix, not an instant chat.

Request a fix