FixesFixes for errors in real apps
One page per error message: what causes it and how to fix it, checked against the vendor’s own docs. If you’d rather hand it over, each page shows how.
Not sure the rules are the problem? Check first, free and in your browser: Firebase Security Rules checker, Supabase RLS policy checker and Supabase grants and RLS checker.
Lovable, Bolt and Replit
- AI builder stuckLovable keeps breaking, and the AI can’t fix the same bugStop retrying the same prompt. Roll back to the version just before the bug appeared, ask the AI to investigate and plan before it builds again, and change one thing at a time. If the bug comes back after a rollback, or it’s in sign-in, payments or who can see which data, bring in a person who reads the code.
- Netlify and Vercel build errorThe app works in Bolt or Lovable, but the deploy build failsScroll up the build log to the first error, not the last line. Most often it’s a missing environment variable: Vite builds VITE_ variables into the code at build time, and Netlify doesn’t read .env files, so they must be set in the host’s settings. Next: a different Node version, a file name whose capital letters don’t match the import, or warnings treated as errors.
- Replit deployment bugUploaded files or saved data disappear after you redeploy your Replit appReplit says to avoid saving and relying on data written to a published app’s file system. A publish is a snapshot of your project’s files, so treat anything the running app writes as temporary, not as part of the next publish. Keep records in a database, such as Replit’s managed PostgreSQL, and uploaded files in object storage, such as Replit’s App Storage.
- Lovable publishing problemMy Lovable app works in the preview, but the published site is blankOpen the published site, open your browser’s developer tools, and read the first red error in the console. It points to the cause. Lovable’s debugging guide suggests pasting that exact error into the project chat. If the console is clean, check that you published your latest changes and that you’re on the right address.
- Lovable GitHub problemMy Lovable project stopped syncing with GitHubCheck the sync status before you push anything. If Lovable says the branch has diverged, your next push replaces Lovable’s version, and edits made only in Lovable drop out of the project. Lovable saves a backup first, but don’t rely on it: keep a copy of those edits before you push. Otherwise, find your symptom below; often it comes down to which branch is synced.
- Lovable security questionIs Lovable safe for a real app?It can be, but protecting your users’ data is your job, so check it before launch. A 2025 vulnerability record, CVE-2025-48757, describes generated sites whose row-level security let anyone read or write tables; Lovable disputes it, saying each customer is responsible for their app’s data. Either way the checks are the same: row-level security on every table, no secret key in the browser, a test with two accounts, and sign-in checked on the server.
- Bolt tokensBolt keeps running out of tokensMost tokens go on Bolt reading and syncing your project files, so bigger projects cost more per message. Ask about specific files, use Plan mode to think things through, and use buttons and Version history instead of prompts, since those don’t use tokens. Stop pressing Attempt fix over and over on the same error: Bolt says each attempt uses tokens and suggests stepping in manually or asking in Plan mode. If the bug is still there after that, a person reading the code can take it over at a fixed price.
- Lovable backendLovable: the edge function can’t read my API keyEdge functions read keys from Secrets by exact name, such as STRIPE_SECRET_KEY. Check the secret exists with the name the function reads, add any secret you skipped when Lovable asked, and don’t put server keys in VITE_ variables, which go to the browser. If two Lovable projects share one Supabase project, they overwrite each other’s secrets.
Supabase
All Supabase fixes on one page
- Supabase setup questionHow do I get a Supabase staging environment and stop testing on production?Use Supabase Branching: a persistent branch for staging, or a preview branch for each pull request. A branch connected to GitHub builds its database structure from the migrations in your repository; every branch starts with no data by default and gets placeholder sign-in secrets. So get your schema into migrations first, then add a seed file and branch secrets. Watch the cost: branches bill by the hour and aren’t covered by the Spend Cap.
- Supabase StorageMy Supabase storage bucket is public. Are the files exposed?A public bucket skips access control for reading files: anyone with a file’s URL can open it. Uploads, deletes and moves are still checked by your policies. Keep public buckets for files meant to be public, move private files to a private bucket with row-level security policies, and serve them through signed URLs or signed-in downloads.
- Supabase RealtimeSupabase Realtime is subscribed, but no changes arriveFirst check the table is in the supabase_realtime publication, since Realtime ignores tables that aren’t. Then check row-level security: Realtime applies it as the subscribing user, so on a table with RLS it only sends changes that user is allowed to see, and SUBSCRIBED doesn’t mean they can. If events arrive but old values are empty, that’s replica identity. Last, check the table name, schema and filter in the subscription.
- Supabase databaseSupabase: too many connections, or remaining connection slots are reservedYour database has a connection limit set by its compute size, and something is opening more connections than it allows. In serverless or edge functions, connect through Supabase’s shared pooler in transaction mode, create the client once, and set its pool to 1 connection. If you’re already pooling and still at the limit, a larger compute size allows more connections.
- Supabase Auth session bugSupabase logs users out when they refresh the pageIn a Next.js or other server-rendered app, use the @supabase/ssr clients so the session lives in cookies, and add the middleware (proxy.ts on Next.js 16) that refreshes it on every request. In a browser-only app, create one Supabase client with persistSession on, and wait for the stored session to load before your route guard sends anyone to the login page.
- Supabase migration errorWhy does supabase db push fail, and how do I fix the migration history?Supabase keeps a list of the migrations it has run on each database and compares it with the files in supabase/migrations. When the two disagree, db push stops. Back up the live database, link the project with supabase link, then run supabase migration list to see where they split. If someone changed the live database by hand, run supabase db pull to capture that as a migration. If only the list is wrong, migration repair fixes the list without running any SQL.
- Supabase database errornew row violates row-level security policy for tableThe table has RLS on and no INSERT policy that this row passes. Add one whose WITH CHECK matches the row, usually user_id = auth.uid(), and make sure the insert sets user_id for a signed-in user. If you call .select() after the insert, or use upsert, the table also needs a SELECT policy the new row passes. Don’t fix it by turning RLS off.
- Supabase Auth email bugSupabase confirmation and reset emails link to localhost:3000Change the Site URL in Supabase under Authentication, URL Configuration, from http://localhost:3000 to your live address. Supabase uses it when your code doesn’t pass a redirect URL. If your code does pass one, that exact URL must also be on the Redirect URLs allow list.
- Sign in with Apple errorWhy does Sign in with Apple return invalid_client?invalid_client means Apple couldn’t find the client ID you sent, or the client secret is invalid or expired. On the web, the client ID must be your Services ID, exactly as registered. In Supabase, list the Services ID first under Client IDs. The secret key for the OAuth flow has to be regenerated every 6 months from your .p8 signing key; an expired one fails with invalid_client too.
- Supabase Edge Functions errorSupabase Edge Function call blocked by CORS policyThe function has to answer the browser’s OPTIONS preflight request and include CORS headers on every response, errors included. Supabase’s wrapper does this for you, or you can import corsHeaders from supabase-js. If it still fails, read the response status: an error can make the browser report CORS when the real problem is something else.
- Supabase Edge Function errorWhy does my Supabase Edge Function time out with a 504 or 546?A 504 means the function didn’t send a response within the 150-second request timeout, usually because of a slow query, a slow outside API or a loop. A 546, Supabase’s own resource-limit code, means it ran out of memory or CPU time, and the function’s logs say which. Speed up or put timeouts on slow calls, split heavy work into smaller jobs, and answer first when the caller doesn’t need to wait.
- Supabase key leakMy Supabase service_role key is exposedTreat the key as compromised. Fix how it leaked first, or the new key leaks the same way. Then create a new secret key, replace the old one everywhere, confirm nothing still uses it, and retire the old key. If it was a legacy service_role key, also revoke the legacy JWT secret. If someone is actively using the leaked key, retire it right away and do the leak fix afterwards. Retiring legacy keys also switches off the anon key, so the site breaks until your apps move to a publishable key. Then check your Supabase logs and tables for changes you didn’t make.
- Supabase Auth email errorSupabase “email rate limit exceeded” on sign-upSupabase’s built-in email service is for trying things out. It only sends to members of your project’s team, and Supabase currently limits it to 2 messages an hour, a number it says can change without notice. Set up custom SMTP with an email provider. Supabase then starts you at 30 messages an hour, which you can raise on the Rate Limits page before a launch.
- Supabase Auth errorSupabase sign-in fails with “Email not confirmed”With Confirm Email on, which is the default on hosted Supabase projects, users have to click the link in the confirmation email before their first sign-in. If they never got the email, check sending first: the default email service allows 2 emails per hour on a best-effort basis, so set up custom SMTP for production. Make sure the link goes to your real site rather than localhost:3000, then resend the confirmation with supabase.auth.resend().
- Supabase Auth errorSupabase sign-up fails with “Database error saving new user”Supabase lists three common causes: a trigger or trigger function on auth.users that has an error, a constraint on auth.users that isn’t met, or Prisma breaking the permissions on that table. Open the Auth logs first, then the Postgres logs, for the exact error. A frequent one is a handle_new_user trigger inserting into a profiles table that doesn’t exist.
- Supabase Edge Functions errorSupabase: “Edge Function returned a non-2xx status code”Your function ran but returned an error status (4xx or 5xx). In supabase-js that is a FunctionsHttpError, and the function’s own error message is in error.context: read it with await error.context.json(). Then check the function’s logs in the Logs tab of the Supabase dashboard, fix what the function reports, and have it return a clear status code and message.
- Supabase Auth errorSupabase users logged out with “Invalid Refresh Token”Each Supabase refresh token can be exchanged only once, for a new access and refresh token pair. Reuse is allowed within a 10-second interval by default, or when the parent of the active token is used; otherwise Supabase treats the whole session as terminated and revokes all its refresh tokens. Look for two places refreshing with the same token, such as the server and the browser, or an app restoring an older saved session.
- Supabase Auth errorSupabase: “Email link is invalid or has expired” (otp_expired)Supabase says the most common cause is email prefetching: a mail client or security tool, such as Safe Links in Microsoft Defender for Office 365, opens the link to check it and uses up the one-time token. Stop the link from consuming the token: put the 6-digit code {{ .Token }} in the email template, or link to a page of your own where the user enters it.
- Supabase email problemWhy do my Supabase sign-up emails go to spam, and how do I fix it?Send through your own email provider (custom SMTP in Supabase, such as Resend or Twilio SendGrid) from your own domain, and verify that domain with the provider so SPF and DKIM pass. Add a DMARC record, starting with p=none, or edit the one you already have. Keep the From: address on the domain you verified, ideally the same domain as your website, and leave open and click tracking off for sign-up emails.
- Supabase project pausedMy Supabase project is paused and my app is downOpen the project in the Supabase dashboard and click Resume project. Supabase says a paused project can be restored for up to 1 year after it was paused. Once it’s back, check your tables and row counts and that the app connects again. For an app with real users, move the project to a paid plan: Supabase doesn’t pause paid projects.
- Supabase key questionIs it safe that my Supabase anon key is in my frontend code?Yes, if row-level security is on. Supabase calls the anon key the legacy version of the publishable key, which it says is safe to expose online, and anyone can read it in your code. Row-level security decides what that key can reach, so turn it on for every table and give each table policies. The key that must never be public is the secret or service_role key.
- Supabase security questionI turned on RLS in Supabase. Is my data safe now?Not necessarily. Turning on RLS is the first step, not the last. Check four things: that signed-out visitors don’t have permissions on tables they don’t need, that any view over a protected table follows the table’s rules, that no rule lets everyone read private data, and that the admin key (secret or service_role) never reaches the browser. Then test the rules by signing in as two different users.
- Supabase published app errorSupabase “TypeError: Failed to fetch” on a published appOpen the browser’s Network tab, reload, and look at the failed request. If its address contains undefined, the Supabase URL never reached the published build. If the address is right, check whether the project is paused, whether an Edge Function is failing its CORS check, and whether a browser extension is blocking the call.
- Supabase API errorSupabase “Could not find the table … in the schema cache” (PGRST205)Supabase’s API can’t see a table with that name. First check the table exists in the project your app’s URL points at, since a migration that never ran, or a staging project, would leave it missing. If it exists, reload the schema cache with NOTIFY pgrst, 'reload schema'; in the SQL Editor. If it lives outside the public schema, expose that schema or name it in the query.
- Supabase Auth errorSupabase “provider_disabled”: the sign-in provider is offEnable the provider on its page in the hosted project’s dashboard, with the client ID and secret from the provider. For local development, Supabase configures the provider in supabase/config.toml instead; we also restart the local stack after editing it. For email or phone sign-up, check that those providers are on as well.
- Supabase Auth errorSupabase “Invalid login credentials” when users sign inCheck error.code. If it is invalid_credentials, Supabase doesn’t say which problem it is: it can mean a wrong password, no account with that email, or an account that only signs in through a social login. Send a password reset if the user has a password account, or point them to the button they signed up with. If the code is email_not_confirmed, it’s a different problem.
- Supabase query errorSupabase PGRST116: .single() got no row, or more than oneIf the row may not exist yet, such as a profile for a brand-new user, use .maybeSingle(), which accepts zero or one row. If the row should exist, check that the user is signed in and that a row level security policy lets them read it. If two rows match, filter on a unique column.
- Supabase query problemSupabase select returns an empty array, but the data is thereCheck that the table has a select policy: with RLS on and no policy, the API returns no data to the browser key. Then check who the request runs as: a signed-out user or an expired session matches no rows in a policy based on auth.uid(). If you get error 42501 instead of an empty array, the role is missing a grant.
- Supabase Auth errorSupabase: “Signups not allowed for this instance”In the Supabase dashboard, open the Authentication settings for sign-ups and turn Allow new users to sign up back on for the project your production app uses. For email sign-ups, check the email provider is enabled too. When you run Supabase locally, set enable_signup = true in supabase/config.toml and restart. Then test a fresh sign-up.
- Supabase Auth errorSupabase: “AuthSessionMissingError: Auth session missing!”The Supabase client you called has no session stored. On the server, create the client with @supabase/ssr and pass it the request’s cookies, and add the proxy (middleware.ts before Next.js 16) that refreshes the session. In the browser, wait until the session has loaded before calling getUser() or updateUser(). On a password reset page, make sure the link’s session is set before updating the password.
- Supabase RLS errorSupabase: “infinite recursion detected in policy for relation”A policy on the table queries a table with RLS on, and that table’s policy ends up running the first policy again. Move the lookup into a security definer function in a private schema, with search_path set to an empty string, and call it from both policies. Don’t fix it by turning RLS off or by writing a policy that lets everyone read.
- Supabase API errorSupabase: “JWSError JWSInvalidSignature” (PGRST301)The token in the request wasn’t signed by this project’s current key. Check that the Supabase URL and the API key in production come from the same project, copy the current key from Settings, then API Keys, and redeploy. If the legacy JWT secret was changed, replace the anon and service_role keys everywhere and have users sign in again.
- Supabase Auth errorSupabase: “Email address is invalid” (email_address_invalid)Supabase Auth refuses example and test domains, so test@example.com or a .test address fails on purpose. Test with a real inbox you control. If a real customer’s address is refused, check for a typo in the domain and that the domain can receive mail. If the error says Email address not authorized instead, that is the default email service’s team-only limit: set up custom SMTP.
- Supabase Auth errorSupabase: “User already registered”With Confirm Email off, signUp() with an email that already has an account returns User already registered. With it on, which is the default on hosted projects, Supabase hides that the account exists and returns what looks like a new user, with an empty identities list. Handle both: tell people to sign in or reset their password, without saying whether the email has an account.
- Supabase and Prisma errorPrisma P1001: “Can’t reach database server” on SupabaseUse a pooler connection string instead of the direct db.[project-ref].supabase.co one. For a serverless app on Vercel or similar, set DATABASE_URL to the transaction pooler (port 6543) with ?pgbouncer=true, and DIRECT_URL to the session pooler (port 5432, which works over IPv4) for migrations, and point Prisma’s migrations at DIRECT_URL (directUrl in schema.prisma, or the datasource url in prisma.config.ts on Prisma 7). Copy both from the Connect button in the Supabase dashboard rather than typing them, then redeploy.
- Supabase and Prisma errorPrisma: “prepared statement "s0" already exists” on SupabaseAdd pgbouncer=true to the DATABASE_URL that points at the transaction pooler (port 6543), so Prisma stops creating prepared statements, then redeploy. Keep DIRECT_URL on the session pooler (port 5432) for migrations, which supports them. Check every place the app reads DATABASE_URL, including preview and production settings on your host.
- Supabase database errorSupabase: “permission denied to change default privileges”The supabase_admin default privileges only apply to objects supabase_admin creates in public, which in practice means extensions installed there. Your own tables get the defaults of postgres, and those you can change. Revoke the postgres defaults, give each new table an explicit grant together with RLS and a policy, and move extensions into the extensions schema. Don’t try to grant yourself supabase_admin: Supabase reserves that membership.
- Supabase database errorSupabase: “permission denied for schema auth”The postgres role holds usage on the auth schema without the grant option, so its grant to your role is quietly ignored. Read the user ID through a small security definer function in a private schema, read it from the JWT claims, or make the role a member of authenticated if it should have everything signed-in users have. Then grant the role your tables, with RLS policies written for it.
- Supabase Auth errorSupabase: AuthRetryableFetchErrorLog error.status. A 0 means no response reached the app: a device offline, a wrong project URL, a paused project or a cancelled request. A 500 on sign-up or password reset usually means the email failed to send through your SMTP settings, or a database trigger failed. A 503 on every Auth request means the Auth service can’t load its configuration, most often an invalid session timebox. Retrying won’t fix a 500 or 503 until the SMTP setting, trigger or Auth setting is fixed.
- Supabase database errorSupabase: “relation does not exist” (42P01)Check three things. Is the table in a schema other than public? Then name the schema in the query, such as supabase.schema('myschema').from('mytable'). Was it created with capitals, like "Profiles"? In supabase-js pass the exact name, such as .from('Profiles'); in SQL wrap it in double quotes; or rename it to lower case. Does it exist in this project at all? Run the information_schema query below against production, not your local or staging database.
- Supabase database errorSupabase: “duplicate key value violates unique constraint”If the constraint ends in _pkey and the id is generated, compare max(id) with the next sequence value and reset the sequence with setval. If it names another column, find out why the same row is inserted twice: a double submit, a webhook delivered again, or a trigger and the app both creating the same profile. Then use an upsert or on conflict do nothing.
Firebase
All Firebase fixes on one page
- Firebase and Google Cloud billingUnexpected Gemini API charges on a Firebase projectStop the spend first: in the Google Cloud console, check the API metrics to see which key made the calls, then rotate it and restrict or delete every API key that allows the Generative Language API and isn’t a server-side Gemini key. If you can’t find the key fast, you can disable billing on the project, after checking what that takes down. Then move Gemini calls behind your server, turn on App Check for the Firebase services your app uses, set spend cap budgets where Firebase supports them, and keep an alert budget on the whole project. Budget alerts only warn you; they don’t stop charges.
- Firebase Firestore errorFirebaseError: Missing or insufficient permissionsUsually the query asks for more than the rules allow. Firestore rules are not filters: if a query could return even one document the user can’t read, the whole query fails. Add the same conditions to the query that the rule checks. Next most likely: no user is signed in yet when the request runs.
- Firebase security alertFirebase says your Cloud Firestore database isn’t properly securedYour rules let people read or write data they shouldn’t, commonly test-mode rules left on after launch, or rules that only check that someone is signed in. Replace them with rules that check who owns each document, test them in the Rules Playground or the emulator, then deploy. Paste your rules into the free checker first to see which patterns you have.
- Firebase Firestore errorFAILED_PRECONDITION: The query requires an indexA query that combines a filter on one field with a sort or range on another needs a composite index, and Firestore doesn’t create those for you. The full error message includes a link that opens the Firebase console with the index filled in: create it, then wait for it to build (a few minutes at least, longer on big collections). Then add it to firestore.indexes.json and deploy it, so every project has it.
- Cloud Firestore quota errorWhy does Firestore say I exceeded my quota?On the free quota, Firestore allows 50,000 document reads, 20,000 writes and 20,000 deletes a day, reset around midnight Pacific time. Hitting the limit usually means something reads the same documents again and again: listeners that reconnect, queries with no limit, offsets, security rules that read other documents, or counting by downloading a whole collection. Check the Usage tab, fix the biggest source, or enable billing and set a budget alert, knowing a budget doesn’t cap usage.
- Firebase Authentication errorFirebase: Error (auth/unauthorized-domain)The domain your app runs on isn’t in Firebase’s Authorized domains list. In the Firebase console, go to Authentication, then Settings, then Authorized domains, and add the exact domain, such as app.example.com, without https:// or a path. Every preview URL counts as its own domain, and projects created after April 28, 2025 no longer include localhost.
- Firebase Authentication errorWhy does Firebase sign-in fail with auth/invalid-credential?With email enumeration protection on, which is the default for projects created on or after September 15, 2023, Firebase returns auth/invalid-credential for any invalid email or password, so your app can’t tell which one was wrong. Show one message such as “Email or password is incorrect”, stop branching on user-not-found and wrong-password, and make the forgot-password flow say an email was sent if the account exists. With protection on, a mistyped password gets the same code, so check the password too.
- Android sign-in errorWhy does Google Sign-In fail on Android with error 10?Status 10 means Google says the app is misconfigured. If sign-in works in debug but fails from Google Play, register the app signing key fingerprint from Play Console, not just your upload key. Add the debug fingerprint too, pass the Web client ID as the server client ID, and if you use Firebase, download the updated google-services.json after adding fingerprints.
- Firebase Cloud FunctionsFirebase Cloud Functions: blocked by CORS policyHTTP functions have no CORS policy by default, so browsers block calls from other sites. Set the cors option on the function to your app’s domains, or to true only for a public API. Callable functions allow all origins by default, so a CORS error there often means the request never reached your code: check the function name, region and deploy before touching CORS.
- Firebase Cloud Functions errorWhy does firebase deploy fail for my Cloud Functions?Read the error’s first line and match it: deploying functions needs the Blaze plan; Node.js 14 and 16 can no longer be deployed; “could not build the function” is often a permission problem on the build service account; “Container Healthcheck failed” means the code failed to start and listen for requests; and 429 or 500 errors on a big deploy mean you deployed a large number of functions at once. Fix that one cause and deploy again.
- Firebase Cloud Functions errorWhy is my Firebase Cloud Function running out of memory?Firebase says 2nd gen functions are powered by Cloud Run, and Google’s Cloud Run docs say a container instance that uses too much memory is terminated, with a log message saying you may have a memory leak or may need more memory. Check the Memory usage plot for the function in the Google Cloud console, then raise the memory option in code if it really needs more, delete files you write to the temporary directory (they count as memory), and stream large files instead of loading them whole.
- Firebase App CheckFirebase App Check is blocking my app’s requestsOnce App Check is enforced, every request without a valid App Check token is rejected. Localhost and CI need a debug token registered in the console, older app versions without the App Check SDK fail until users update, and enforcement can take up to 15 minutes to apply. Check the App Check metrics before enforcing, and keep it on.
- Firebase Auth errorFirebase: auth/requires-recent-login when deleting an accountDeleting an account, setting a primary email address and changing a password need a recent sign-in. If the user signed in too long ago, Firebase fails the action with auth/requires-recent-login. Ask the user to sign in again, pass the new credential to reauthenticateWithCredential, then retry the action. Account deletion can also run on your server with the Admin SDK, which deletes users by uid.
- Firebase Storage errorFirebase Storage “storage/unauthorized” errorYour Cloud Storage Security Rules rejected the request. Check three things: the rules allow this action for this user, the user is signed in before the upload starts, and the file path matches the path in the rule, such as a folder named after the user’s uid. Don’t fix it by allowing everyone: Firebase strongly recommends restricting access.
- Firebase Cloud Messaging errorFCM “messaging/registration-token-not-registered” (UNREGISTERED, 404)The device token you sent to is no longer valid: the app was uninstalled, the token expired or was refreshed, or the app unregistered. Firebase says to delete that token from your server and stop sending to it. Then make sure the app sends its current token to your server every time it gets one, so each user has a fresh token on file.
- Firebase Auth errorFirebase “auth/too-many-requests”Firebase refused the request because a request limit was exceeded. New accounts are limited per IP address, and SMS codes are limited per IP address and per phone number. During testing, use fictional phone numbers from the Firebase console and stop scripts that create accounts in a loop; for real users, wait and retry later.
- Firebase Auth errorFirebase Google sign-in fails with “auth/popup-blocked” on the live siteBrowsers only allow a popup that opens right after a click. If your code awaits something (loading config, a network call) before signInWithPopup, the click may no longer count, and the browser can block the popup. Call signInWithPopup first thing in the click handler, or use signInWithRedirect, following Firebase’s redirect best practices.
- Flutter and Firebase errorFlutter: “No Firebase App ‘[DEFAULT]’ has been created”Call WidgetsFlutterBinding.ensureInitialized(), then await Firebase.initializeApp() with DefaultFirebaseOptions.currentPlatform, all before runApp. If the crash happens when a message arrives in the background, call Firebase.initializeApp() inside the background message handler too, as Firebase’s own example does.
- Firebase Auth errorFirebase “auth/operation-not-allowed”The sign-in provider your code calls is disabled for this Firebase project. In the Firebase console, open Security, then Authentication, then the Sign-in method tab, and enable the provider: Email/Password, Email link, Phone, Anonymous or a social provider. For email link sign-in, Email/Password must be on as well.
- Firebase Auth errorFirebase: “auth/invalid-api-key”, but only in productionThe deployed build has no Firebase API key, or the wrong one. Add the key to your host’s production environment variables using the prefix your framework exposes to the browser (VITE_ for Vite, NEXT_PUBLIC_ for Next.js, EXPO_PUBLIC_ for Expo), then rebuild and redeploy, since the value is baked in at build time. Copy it from the web app’s config in the Firebase console.
- Firebase phone sign-in errorFirebase phone sign-in: “auth/invalid-app-credential”Firebase couldn’t verify that the request came from your app. On the web, add your live domain to Authorized domains and render the reCAPTCHA verifier before calling signInWithPhoneNumber. On Android, add the app’s SHA-256 fingerprints, including the Play App Signing one, in the Firebase console. On iOS, upload an APNs key and add the URL scheme so the reCAPTCHA fallback works.
- Firebase Auth errorFirebase: “auth/network-request-failed”The request to Firebase Auth never got an answer. Open the browser’s network tab and retry: a blocked or failed request to identitytoolkit.googleapis.com or securetoken.googleapis.com shows the cause. Common ones are an ad blocker or privacy extension, a Content Security Policy that leaves out Google’s hosts, the app still pointing at the Auth emulator, or a form that reloads the page mid-request.
- Firestore errorFirestore: “Failed to get document because the client is offline”Firestore’s get() tried the server, failed or timed out, and found nothing in the offline cache. Check that the firebaseConfig projectId matches a project with a Firestore database, and that nothing (an ad blocker, proxy or firewall) blocks firestore.googleapis.com. For first-load screens, a realtime listener (onSnapshot) delivers data once the connection arrives, where a one-off get() fails.
- Firebase and Google Cloud billingFirebase bill spike: find what’s spending, then stop itOpen Usage and billing in the Firebase console settings to see which product grew, then that product’s Usage tab for the day it started. Look for a query with no limit, a listener that reloads data, or a Cloud Function that writes to the document that triggered it (for Gemini charges, see the API key page linked below). Fix that code first. Then set an alerts-only budget on the project and spend cap budgets on the services that support them, because an alert email doesn’t stop anything by itself.
Stripe
- Stripe webhook errorNo signatures found matching the expected signature for payloadUsually it’s the wrong signing secret. Each endpoint has its own, the Stripe CLI prints a different one, and the same endpoint has a different secret for test and live keys. Next most likely: your framework parsed or changed the request body before the signature check ran.
- Stripe fulfillment bugThe payment went through in Stripe, but the account was never upgradedMost often, the upgrade only runs on the success page after checkout. Stripe says you can’t rely on that page, because customers don’t always reach it. Grant access from a webhook instead, and check the webhook’s delivery log in the Dashboard for failed deliveries.
- Stripe Billing errorWhy is my Stripe subscription stuck as incomplete?A new subscription stays incomplete until its first invoice is paid, and the customer has 23 hours. If the PaymentIntent says requires_action, the card needs authentication: listen for invoice.payment_action_required, send the customer through it with stripe.handleNextAction, and give access only after invoice.paid or an active subscription. After 23 hours it becomes incomplete_expired and you need a new subscription.
- Stripe payment errorWhy does Stripe say the card was declined with generic_decline?Stripe’s docs say card issuers categorize most declines as generic, so the exact decline reason is often unclear. Check the payment in the Dashboard: if Radar blocked it, the outcome type is blocked and you can allow-list a legitimate payment; if the issuer declined it, read the decline code and the advice code, ask the customer to re-enter the card or use another one, and don’t keep retrying a charge the advice code says not to.
- Stripe BillingStripe subscription canceled, but access in the app is wrongWhen a customer cancels at period end, the subscription runs on until the period ends, cancel_at_period_end becomes true, and Stripe sends customer.subscription.updated. Access should continue until the period ends. When it ends, Stripe sends customer.subscription.deleted: that’s the event that should remove access. Removing access on the update cuts people off early; ignoring the deleted event never removes it.
- Stripe BillingThe Stripe customer portal isn’t workingSave the portal settings in the Dashboard for live mode as well as sandboxes, since each has its own. Create a new portal session on your server each time a signed-in customer clicks the button, because session links are short-lived, and pass a return_url unless a default is set. Then listen to subscription webhooks so the app follows what customers change.
- Stripe API errorNo such customer: ‘cus_…’; a similar object exists in test mode, but a live mode key was used to make this requestStripe keeps test and live data apart: an ID created with test keys doesn’t exist in live mode. Your database still holds customer IDs saved during testing, and the app now calls Stripe with live keys. Create a new live customer for each user whose saved ID came from testing, and make sure every server and environment uses keys from the same mode.
- Stripe Billing errorStripe: “This customer has no attached payment source or default payment method”For a subscription invoice, Stripe uses the subscription’s default_payment_method; if that isn’t set, it uses the customer’s invoice_settings.default_payment_method or default_source. The error means none of them gave it a payment method to charge. Set the card as the customer’s invoice_settings.default_payment_method, and for new subscriptions set payment_settings.save_default_payment_method to on_subscription.
- Stripe go-live problemStripe checkout works in test mode but fails in live modeTest mode (Stripe now calls it a sandbox) and live mode have separate API keys, products, prices, customers and webhook endpoints, and nothing created in one exists in the other. Put the live keys in your production app’s settings, recreate your products and prices in live mode and switch their IDs in your code, add a live webhook endpoint with its own signing secret, then redeploy.
- Stripe webhook problemStripe shows the webhook delivered, but my database never updatedA 200 only means your endpoint received the event. Stripe asks you to answer quickly, before the slow work, so if the database write fails after that, Stripe still records a successful delivery and has nothing to retry. Your own server logs hold the error. Check them first, then the event types your endpoint receives, repeated or out-of-order events, and the database key your handler writes with.
- Stripe Connect errorStripe Connect: the seller finished onboarding, but charges or payouts are still disabledComing back to your return URL doesn’t mean onboarding is complete. Retrieve the account and read its requirements: as long as requirements.currently_due isn’t empty, it can be restricted. Send the seller back through a new Account Link when anything is due, create a fresh link from your refresh URL when one expires, and listen to account.updated so new requirements don’t surprise you.
- Stripe payments problemStripe: Apple Pay or Google Pay doesn’t show in the payment formRegister every domain and subdomain that shows the payment form on the Payment method domains page, in live mode as well as each sandbox. If the form sits in an iframe, register both domains. Then confirm the wallets are on in your Payment Method Configurations, and test on a device with a real card in the wallet, outside a private window.
- Stripe payment errorStripe: “You cannot confirm this PaymentIntent because it has a status of succeeded”The PaymentIntent was already paid, so Stripe refuses to confirm it again. Check the Dashboard first: if the payment shows as succeeded, the customer was charged once and nothing needs refunding. Then find what confirmed it twice: a pay button that stays clickable, a page that confirms again on reload, or a retry after a timeout. Fulfil the order from the payment_intent.succeeded webhook, not from the browser.
- Stripe go-live errorStripe: “Invalid API Key provided”Check the key your production server actually sends. It must be a secret key (sk_live_) or a restricted key (rk_live_) from the Stripe account you mean, copied whole, and not one that was rolled or deleted. Copy the current key from the Dashboard into your host’s production environment variables, redeploy, and never put it in front-end code.
Mobile builds, networking and in-app purchases
Guide: Expo and Flutter build errors
- Flutter iOS build errorFlutter iOS build fails at pod installRead the CocoaPods output for the pod it names. If it says it could not find compatible versions, the Podfile.lock is holding an old version: run pod update with that pod’s name inside the ios folder. If it says a pod needs a higher minimum deployment target, raise platform :ios in ios/Podfile. Update CocoaPods itself if it’s old. If the pod is a Firebase one, note that new Firebase versions aren’t published to CocoaPods after October 2026, and Flutter 3.44 and later use Swift Package Manager by default.
- Flutter iOS push errorFlutter push on iOS: “APNS token has not been set yet”On Apple platforms the APNs token has to be available before you make FCM plugin calls, and it isn’t guaranteed to have arrived yet. Request notification permission, check that getAPNSToken() returns a value, then make your other FCM calls. If it never arrives, check that Push Notifications and the background modes are on in Xcode, that an APNs authentication key is uploaded in the Firebase console, and that method swizzling hasn’t been turned off.
- Flutter Android build errorWhy does my Flutter build say “Unsupported class file major version”?The Java version building your app is newer than your project’s Gradle version can handle. Flutter builds with the Java bundled with Android Studio, so an Android Studio update can trigger it. Run flutter analyze --suggestions to see which of AGP, Java and Gradle don’t fit together, then update the Gradle wrapper to the suggested version, or set the Java version Flutter uses with flutter config --jdk-dir.
- Expo EAS Build errorExpo EAS build failed: the app runs locally, the build doesn’tOpen the failed build on the EAS dashboard and read the first phase that failed, not the last; lines marked [stderr] are often only warnings. Then check the usual causes in order: a file your code imports is in .gitignore so it never uploads, your .env values aren’t on the build server, the JavaScript doesn’t bundle (run npx expo export locally), or a package doesn’t match your Expo SDK (run npx expo-doctor).
- Expo runtime errorExpo app works in Expo Go, crashes in TestFlight or productionExpo calls this a runtime error: the build succeeded, but the app crashes or hangs when it runs. Start with the crash report, in the Google Play Console’s crashes section or Xcode’s Crashes Organizer for TestFlight and App Store builds. Then capture native logs from a device that crashes, and run the app locally in production mode with npx expo start --no-dev --minify. We also check that the environment variables the app reads are set for the build, then narrow it down change by change.
- Expo push notification problemWhy are my Expo push notifications not arriving?Send one test notification and read the push receipt: it names the error. A notification that works in development but not in the store build usually means the production credentials are missing or wrong: on Android, the FCM V1 service account key uploaded to EAS; on iOS, the push key. Then check that the app still holds a valid token for that user, and send with high priority on Android.
- RevenueCat errorRevenueCat: “None of the products registered in the RevenueCat dashboard could be fetched”The store returned none of the products RevenueCat asked for. Check, in order: the store agreements and banking are complete, the product IDs and bundle ID or package name match exactly, the SDK uses the API key for this platform, and the products are ready to load where you test: a physical device, a sandbox account on iOS, and a closed track on Google Play.
- Xcode signing errorXcode: Signing for “Runner” requires a development teamSelect the Runner target in Xcode, open Signing & Capabilities, keep Automatically manage signing on, and choose your team. If your team isn’t listed, add your Apple account first. Then check that the Bundle Identifier matches the App ID you registered.
- Expo EAS Update problemExpo: you published an EAS Update, and the app still shows the old versionFirst, close the app fully, open it, then close and open it again: by default the update downloads on one cold start and loads on the next. If it still doesn’t appear, compare the build’s runtime version and channel on the Deployments page with your update’s runtime version and branch, map the channel to the branch you published to, and check whether the update crashed and rolled back.
- App Store Connect statusTestFlight build stuck on “Missing Compliance”Open the build in App Store Connect and answer the export compliance questions about encryption. To stop it on every upload, add the ITSAppUsesNonExemptEncryption key to Info.plist: NO if the app uses no encryption or only exempt encryption, YES if it uses non-exempt encryption, and then you typically also add the code Apple gives you after reviewing your documentation.
- Android network errorAndroid app can’t reach an http:// address: cleartext is blockedServe the API over HTTPS and update the URL in the app; that needs no Android setting. If you must reach an http:// address, such as a local server during development, allow cleartext for that one domain in a Network Security Configuration file. Avoid allowing it for every domain.
- Expo Go errorExpo Go: “Project is incompatible with this version of Expo Go”Check the expo version in package.json, then install the Expo Go build for that SDK from expo.dev/go on Android or the iOS Simulator. On a physical iPhone, the App Store has Expo Go up to SDK 54; SDK 55 and later need eas go through TestFlight. For an app you plan to ship, Expo recommends a development build instead of Expo Go.
- iOS push notification erroriOS: “no valid aps-environment entitlement string found for application”Turn on the Push Notifications capability for the app target in Xcode, under Signing & Capabilities, and make sure the App ID has Push Notifications enabled. Then build with a provisioning profile created after that change. In Expo, Flutter or other generated projects, check the entitlement survives the build, then build and install again.
- React Native Android errorReact Native: “Unable to load script. Make sure you’re either running Metro…”On a release APK or AAB, the JavaScript bundle is missing: build with cd android && ./gradlew bundleRelease (AAB) or ./gradlew assembleRelease (APK), and remove org.gradle.configureondemand=true from gradle.properties if it is there, because it skips bundling. In development, start Metro with npx react-native start, then connect the device with adb reverse tcp:8081 tcp:8081, or set your computer’s IP and port 8081 in the dev settings.
- Flutter errorFlutter: “MissingPluginException(No implementation found for method …)”Stop the app completely and run it again, so the native code is compiled in. Hot reload and hot restart aren’t enough. If it still fails, run flutter clean and flutter pub get, run pod install on iOS, and check the plugin supports the platform you’re running on, such as web or desktop.
- Flutter Android build errorFlutter: “Gradle task assembleDebug failed with exit code 1”Scroll up from the exit line to the first error, or run flutter run -v to see the full Gradle output. If it mentions Java or an unsupported class file version, run flutter doctor to see which Java is in use, and flutter analyze --suggestions from the project folder to check that Java, Gradle and the Android Gradle plugin fit together. If it points at a build file, run ./gradlew help in the android folder to check the build scripts on their own.
- Expo and React Native errorExpo and React Native: “Unable to resolve module”If the name is a package, install it with npx expo install package-name and commit package.json and the lockfile. If it starts with @/ or ~/, add the alias to tsconfig.json and restart Expo CLI. If it is a file path, check the folder and the exact upper and lower case of the file name. If none of those, clear the caches and start again with npx expo start --clear.
- React Native errorReact Native: “Text strings must be rendered within a <Text> component”Wrap every piece of text in <Text>. Then look for {count && <Something />} where count can be 0: React renders the 0 as text. Change it to {count > 0 && <Something />}. Also check for a stray space, semicolon or // comment between tags inside a View. The red box’s component stack names the component to look in.
- iOS signing errorXcode: provisioning profile is invalid, expired or doesn’t include your certificateSomething the profile lists changed. You added a capability such as push notifications or Sign in with Apple, the certificate was revoked or replaced, a test device is missing, or the profile expired. Regenerate the profile in Certificates, Identifiers & Profiles, or turn on Automatically manage signing so Xcode does it. If a build service signs your app, give it the new profile too.
- Flutter Android build errorFlutter: “Your project requires a newer version of the Kotlin Gradle plugin”Raise the Kotlin version in your Android build files. In projects made with Flutter 3.16 or later it is the org.jetbrains.kotlin.android line in android/settings.gradle (or settings.gradle.kts). In older projects it is ext.kotlin_version in android/build.gradle, which is the file Flutter’s error message names even on newer projects. To find a version that works with your Flutter release, create a new project with the same Flutter version and copy its value, then run flutter clean and build again.
- Expo and React Native errorExpo: “Native module cannot be null” or “Cannot find native module”If the library isn’t part of Expo Go, run the app in a development build instead: install expo-dev-client, build once with EAS or locally, then start the server as usual. If the missing module is an Expo package such as ExpoCamera and you use a development build, rebuild it: the package was probably added after the build. Then run npx expo install --fix to catch versions that don’t match your SDK.
- Android build errorAndroid: “Manifest merger failed”Read the full error or open the Merged Manifest tab in Android Studio: it names the element and the conflicting files. If it mentions android:exported, add android:exported="true" to the launcher activity and "false" to other components with intent filters unless another app must start them (a share target or deep link), and update any library whose manifest lacks it. For an attribute clash, keep your value with tools:replace. For a minSdk clash, raise your minSdk or, if you are sure, use tools:overrideLibrary.
- Flutter layout errorFlutter: “A RenderFlex overflowed by … pixels on the right” (or bottom)Constrain the child that is too big. In a Row, wrap the long text or the inner Column in Expanded or Flexible so it takes the remaining width and wraps. In a Column that runs off the bottom, wrap the content in a SingleChildScrollView, or give the growing child Expanded. Then test with the largest text size and on a small screen.
- Flutter errorFlutter: “setState() or markNeedsBuild() called during build”Move the state change out of build. Show dialogs and navigate from an event handler, such as onPressed, or after the first frame with WidgetsBinding.instance.addPostFrameCallback in initState. If a ChangeNotifier calls notifyListeners during build, trigger that update from initState or an event instead.
- Flutter layout errorFlutter: “RenderBox was not laid out”Find the first layout error above it in the console and give that widget a size. A ListView or GridView inside a Column needs Expanded, Flexible or a SizedBox with a height. A TextField inside a Row needs Expanded or a SizedBox with a width. A nested list inside another scroll view can use shrinkWrap: true with NeverScrollableScrollPhysics for short lists.
- Flutter and Dart errorFlutter: “Null check operator used on a null value”Open the first line of the stack trace that is in your own code and find the ! on it. Replace it with a null check, a default (value ?? fallback), or the ?. operator. The usual culprits are snapshot.data! before a FutureBuilder has data, ModalRoute.of(context)!.settings.arguments on a route opened without arguments, a GlobalKey’s currentState! before its widget is on screen, map['key']! for a key the API did not send, and a field that is set later than the code that reads it.
- Android build errorAndroid: “Duplicate class ... found in modules”Read the two module names in the error. If they are kotlin-stdlib and kotlin-stdlib-jdk7 or -jdk8, align the Kotlin versions: update the Kotlin Gradle plugin and any library pinning an old stdlib, or add the Kotlin BOM. If the same library appears twice (a local .jar plus the Maven artifact, or bundled inside another library), remove one. Otherwise run ./gradlew app:dependencies, find which dependency brings the second copy, and exclude that module from it.
- iOS build errorXcode: “No such module 'Name'”With CocoaPods (including Flutter and React Native apps), close Xcode, run pod install in the ios folder, and open the .xcworkspace, not the .xcodeproj. With Swift Package Manager, check the package is added to this target under General, Frameworks, Libraries, and Embedded Content, then use File, Packages, Reset Package Caches. If it fails only for one scheme or for tests, add the dependency to that target too. Clearing DerivedData fixes stale builds after the rest is right.
- iOS build errorXcode: “Command PhaseScriptExecution failed with a nonzero exit code”Open the Report navigator (the last tab in the left sidebar), select the failed build and expand the failing script step to read its own error. Then fix that: a line like “Sandbox: rsync.samba(...) deny(1) file-write-create” means user script sandboxing (Build Settings, Build Options, User Script Sandboxing: No for the app target); “node: command not found” in React Native means Xcode can’t find Node (set NODE_BINARY in ios/.xcode.env.local); “The sandbox is not in sync with the Podfile.lock” means run pod install.
- Android build errorGradle: “Could not resolve all files for configuration”Read the “Could not find” line and the “Searched in the following locations” list under it. If the library is not on google() or mavenCentral(), add the repository it is published to in settings.gradle. If the list includes jcenter(), replace it, because JCenter is read-only. If the version does not exist, fix the typo or pick a published version. If nothing downloads at all, turn off Gradle offline mode, check the proxy settings, and run ./gradlew --refresh-dependencies.
- Android build errorGradle: “Execution failed for task ':app:...'”Scroll to What went wrong and read the indented lines under the task name; the last > line is usually the real cause. Run ./gradlew assembleDebug --stacktrace for the full detail. Then match the task: compile tasks mean a code or JDK/Kotlin version problem, merge and process resource tasks mean a broken resource or manifest, checkDebugAarMetadata means a library needs a higher compileSdk (or a newer Android Gradle Plugin), and mergeDex tasks mean a D8 dexing error such as the 64K method limit.
- React Native errorReact Native: “TypeError: Network request failed”Check the URL first. If it starts with http://, iOS (App Transport Security) and Android 9 and later block it by default; use HTTPS, or add a narrow exception for your development host. If it says localhost, a phone or emulator cannot reach your computer that way: use your computer’s LAN IP, 10.0.2.2 on the Android emulator, or a tunnel. If it is HTTPS and still fails on Android, check that the server sends its full certificate chain. For uploads, do not set the multipart Content-Type header yourself.
Hosting, Vite, Next.js, sign-in and Google Maps
All Vercel and Next.js fixes on one page
- Vercel errorVercel function times out with a 504 (FUNCTION_INVOCATION_TIMEOUT)Vercel returns a 504 when a function doesn’t finish within its maximum duration, and that time includes sending the response. Find the slow call first: an AI or outside API with no timeout, a slow database query, or a database far from the function’s region. Then stream the response or move long work to a background job. Raise maxDuration last, within your plan’s limit.
- Netlify errorNetlify Function times outNetlify gives synchronous functions 60 seconds and scheduled functions 30 seconds, and neither limit is configurable. So find the slow part instead of looking for a setting: an outside call with no timeout, a database far from the function’s region, or heavy work inside the function. Work that takes longer belongs in a background function, which answers with 202 straight away and can run for up to 15 minutes.
- Vercel errorWhy does my Vercel Function return 413 FUNCTION_PAYLOAD_TOO_LARGE?Vercel caps the request body and the response body of a Vercel Function at 4.5 MB. If a file upload goes through your function, upload it from the browser straight to storage instead, for example with Vercel Blob client uploads. If the response is too big, return less per request or stream it. When you measure, remember the browser’s network tab shows the gzipped size by default.
- Vercel deploymentVercel environment variable is undefined in productionVercel applies a new or changed variable only to new deployments, so redeploy (a new build) after saving it. Check it’s enabled for the right environment, Production or Preview. And if the browser needs it, it must use your framework’s public prefix, such as NEXT_PUBLIC_ in Next.js, which also means it’s visible to anyone, so never put secrets there.
- Next.js and React errorNext.js hydration error: the server HTML didn’t match the browserFind what renders differently on the server and in the browser. Most often it’s a browser-only value read during render (window, localStorage, the current time, a random number): move it into useEffect, so the first browser render matches the server. If that isn’t it, check for invalid HTML nesting, such as a <div> inside a <p> or a link inside a link, then test in a private window without extensions.
- Google sign-inGoogle sign-in: Error 400: redirect_uri_mismatchGoogle only sends users back to addresses listed under Authorized redirect URIs on your OAuth client in the Google Cloud console, and the match must be exact: http or https, upper and lower case, and the trailing slash. Copy the exact callback address your auth provider uses, add it to the OAuth client the app actually uses, and try again.
- Netlify and Vercel deploy error404 "Page not found" when you refresh a page or open a linkYour app is a single-page app: one index.html that handles every route in the browser. When you refresh /dashboard, the host looks for a file at that path, finds none and returns 404. Add a rewrite that serves index.html for every path: a _redirects file on Netlify, or a vercel.json rewrite on Vercel.
- Vercel build errorVercel build fails with Module not found: Can’t resolve, but works locallyVercel says this error almost always means the casing in an import doesn’t exactly match the filename. Your Mac or Windows machine ignores the difference by default; Vercel’s Linux build doesn’t. Find the path in the Build Logs and make the import and the filename match exactly. If Git missed a case-only rename, rename through a temporary name with git mv. Otherwise check for a package missing from package.json or a wrong relative path.
- Vite deployment errorVite “Failed to load module script”: MIME type of “text/html”The browser asked for one of your JavaScript files and got HTML back. Usually the visitor has old HTML pointing at chunk files the latest deploy removed, and a catch-all rewrite answers the missing file with index.html. Serve the HTML with Cache-Control: no-cache, as Vite says. We also reload the page on Vite’s vite:preloadError event, and check the base setting if the app lives in a subfolder.
- Vercel functions errorVercel FUNCTION_INVOCATION_FAILED (500 Internal Server Error)The function crashed while handling the request. Open the deployment’s Logs tab and find the error from the failing request. Typical causes are an error your code didn’t catch, or a setting such as an environment variable that’s missing in production. Fix that, wrap the handler in try/catch so it returns a real error response, and redeploy.
- Google Sign-In on iOSiOS crash: “No active configuration. Make sure GIDClientID is set in Info.plist”Add your iOS OAuth client ID to Info.plist under the GIDClientID key, and add the reversed client ID as a URL scheme under CFBundleURLTypes. Both come from the iOS OAuth client in the Google Cloud console. Then rebuild the app.
- Next.js build errorNext.js: “useSearchParams() should be wrapped in a suspense boundary”Move the code that calls useSearchParams() into a small Client Component and wrap it in <Suspense>. That keeps the rest of the page static. If the whole route should render on each request instead, call connection() in the Server Component page. To find the component, run next build --debug-prerender.
- Vercel deployment errorVercel “404: NOT_FOUND” on a deployment that says ReadyFirst open the .vercel.app URL. If it works and your own domain doesn’t, fix the DNS records. If both 404, check that the Framework Preset isn’t set to Other and that the Output Directory matches where your build writes files, then redeploy. If only dynamic routes 404, set dynamicParams or render them dynamically.
- Next.js build errorNext.js “DynamicServerError: Dynamic Server Usage”A function like cookies() or headers() from next/headers ran outside the call stack Next.js bound it to: inside a setTimeout or setInterval, or after a promise you didn’t await. Call it outside the timer or callback, then pass the values in. Await every promise that calls it.
- Google Maps errorGoogle Maps shows “for development purposes only” or won’t loadOpen the browser console on the page with the map and find the error ending in MapError. RefererNotAllowedMapError means your site’s address isn’t on the key’s allowed websites. ApiNotActivatedMapError means the Maps JavaScript API isn’t enabled. BillingNotEnabledMapError means the project has no billing. InvalidKeyMapError means the key in the page isn’t recognised.
- Vercel deployment errorVercel won’t deploy: the commit author isn’t the owner or a team memberOn a Hobby team, a private repo in a GitHub organization, GitLab group or Bitbucket workspace can’t deploy: make it public or move to Pro. Other private repos deploy only commits made by the team owner. On Pro, the commit author must be a team member: add or approve them, then redeploy. If Vercel can’t identify the author, check that the commit email matches a verified email on the Git account.
- Vercel domain errorVercel “ERR_TOO_MANY_REDIRECTS” with Cloudflare in frontA common cause is Cloudflare’s Flexible mode: in Cloudflare’s SSL/TLS settings, change Flexible to Full (strict), which needs a valid certificate on the Vercel side. If the loop continues after that, look for app redirects, Vercel domain redirects and Cloudflare rules that send the same address back and forth.
- Node.js build errorNode.js “ERR_OSSL_EVP_UNSUPPORTED” when building an older appUpgrade the build tool or the dependency that uses the old algorithm, so the app builds on current Node.js. As a temporary workaround, Node.js offers the --openssl-legacy-provider option, which you can pass through NODE_OPTIONS in the build command.
- Next.js image errorNext.js image error: the hostname isn’t configuredAdd the image’s address to images.remotePatterns in next.config.js, with the same protocol, hostname, port and path the src uses. In our experience you then need to restart the dev server or redeploy before the change shows. Most cases we see are a missing subdomain, such as storage or cdn in front of the domain.
- Next.js Server Action errorNext.js Server Action fails on uploads over 1 MBFor forms that are only a little over 1 MB, raise serverActions.bodySizeLimit in next.config.js and leave some room for the upload overhead. For real files, such as photos or PDFs, upload from the browser straight to storage and send only the file’s address to the Server Action. On Vercel, a function can’t take a body over 4.5 MB whatever the setting.
- Vercel access problemVercel preview link asks visitors to log in to VercelSend people the production domain, or a Shareable Link for the preview deployment. For tools such as tests or webhooks, use Protection Bypass for Automation with its secret in a header. Turning protection off makes every existing deployment public, so we keep it on.
- Google sign-in warning“Google hasn’t verified this app”If the app only needs sign-in (name, email, profile), request just those scopes and publish the app to In production: Google treats those scopes as non-sensitive, so they don’t need verification. If it needs Gmail, Drive or Calendar data, list the exact scopes on the consent screen and submit the app for verification. Restricted scopes, such as most Gmail access, also need a security assessment. Until then, users see the warning and the app is capped at 100 new users.
- Vercel build errorVercel: “Command "npm run build" exited with 1”Open the failed deployment, expand Building in the build logs, and scroll up from the exit line to the first red error. That message is the problem: a type error, a missing module, a missing environment variable or a page that fails while prerendering. Run npm run build on your own machine to reproduce it, fix it, then push again.
- Next.js errorNext.js: “ReferenceError: window is not defined”Code that uses window, document or localStorage must run only in the browser. Put it inside useEffect in a Client Component, or load the component that needs it with next/dynamic and ssr: false from a Client Component. Adding "use client" alone isn’t enough: Client Components are still rendered on the server once.
- Next.js build errorNext.js: “Module not found: Can’t resolve ‘fs’”A file in the client bundle imports a Node.js module. Follow the import trace in the error to the "use client" file that pulls it in, then move the server code into a Server Component, a server action or a route handler, and pass only the data to the client. Add import "server-only" to server files so the next mistake fails clearly.
- Google sign-in errorGoogle sign-in: “Access blocked” Error 403: disallowed_useragentGoogle sign-in must open in the device’s real browser or through Google’s native sign-in SDK, not inside a WebView. In your own app, switch to the native Google Sign-In SDK, or open the sign-in URL with ASWebAuthenticationSession on iOS and Custom Tabs on Android. For visitors arriving from social apps, detect the in-app browser and ask them to open the page in their browser, and offer email sign-in as a fallback.
- Browser errorMixed Content: “The page was loaded over HTTPS, but requested an insecure resource”Your HTTPS page asked for something over plain http://. Browsers block scripts, stylesheets, iframes, fonts and fetch() or XHR calls to http:// outright, so the request never reaches your server. Find the http:// address in the console message, serve that resource over HTTPS, and change the link to https:// or a relative path. Check your environment variables first: an API URL saved as http:// is a frequent cause.
- React errorReact: “Too many re-renders. React limits the number of renders to prevent an infinite loop”Something sets state on every render. The most common cause is onClick={handleClick()}, which calls the function during render instead of passing it. Write onClick={handleClick} or onClick={() => handleClick(id)}. If the loop runs through useEffect, the Effect sets state that changes its own dependencies: remove the Effect, depend on a primitive value instead of an object, or keep the value in a ref.
- Next.js build errorNext.js: “The edge runtime does not support Node.js 'crypto' module”Either stop using the Node.js API in that file or move the file to the Node.js runtime. Replace crypto with the Web Crypto API (crypto.subtle) and a Node-only JWT library with an Edge-ready one such as jose. On Next.js 15.5, add export const config = { runtime: 'nodejs' } to middleware.ts; on Next.js 16, rename middleware to proxy, which always runs on Node.js. Next.js dev shows which file imports the module.
- Vercel deploy errorVercel: “Serverless Function has exceeded the unzipped maximum size of 250 MB”Set VERCEL_ANALYZE_BUILD_OUTPUT=1 and redeploy to see each function’s size. Remove duplicates with npm dedupe, move images, videos and big JSON files to public or to storage, and keep large files out with outputFileTracingExcludes in next.config.js (or excludeFiles in vercel.json outside Next.js). If the function really needs the size and your project is eligible, Vercel’s large functions (beta) allow up to 5 GB.
- React errorReact: “Invalid hook call. Hooks can only be called inside of the body of a function component”Check where the Hook is called first: it must be at the top level of a function component or a custom Hook, never inside a condition, loop, event handler, class component or the function you pass to useEffect or useMemo. If the code looks right, run npm ls react. More than one copy of React, often from a library that lists react as a dependency or from npm link, causes the same error. Also check that react and react-dom are the same version. Make every package use one React and restart the dev server.
- React warningReact: “Each child in a list should have a unique "key" prop”Give the outermost element returned from .map() a key that is unique among its siblings and stays the same between renders, usually the item’s id from the database. Do not use Math.random() and avoid the array index when the list can change order. If each item renders several elements, wrap them in <Fragment key={item.id}>, because the short <>...</> form cannot take a key.
- Node.js and JavaScript errorSyntaxError: “Cannot use import statement outside a module”In Node.js, add "type": "module" to the nearest package.json, or rename the file to .mjs. If the project has to stay CommonJS, switch the file to require() or rename it .cjs. In the browser, load the script with <script type="module">. In Jest, use a transform such as babel-jest or ts-jest, or run Jest with NODE_OPTIONS=--experimental-vm-modules and transform: {}, because it runs files as CommonJS by default.
- Browser error“Access to fetch has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present”Make the API answer with Access-Control-Allow-Origin set to your site’s origin, for example https://yourapp.com, and answer OPTIONS preflight requests with the methods and headers you send. Do not use * for an API that uses cookies or auth. If you don’t control the API, call it from your own backend or a serverless function and have that return the data to your page.
- Node.js errorNode.js: “Error: Cannot find module”Read the name in quotes. If it is a package name (like 'express'), run npm install in the folder that holds package.json, and check the package is under dependencies, not only devDependencies, if production installs skip dev packages. If it is a path ('./utils/db' or '/app/dist/index.js'), check the file exists at that path with that exact case, and that the build step that creates it ran. If it started after a Node.js upgrade, delete node_modules and run npm ci.
- Node.js errorNode.js: “ENOENT: no such file or directory”Look at the full path in the error. If it is relative (like ./data/config.json), Node.js resolved it from the folder you started the process in, not from the file’s folder: build it with path.join(__dirname, ...) instead. If the path looks right, the file is missing at runtime: it was not copied into the build or Docker image, a folder needs creating first (fs.mkdir with recursive: true), or a serverless host only has a writable /tmp. During npm install, ENOENT on package.json means you ran npm in the wrong folder.
- Node.js errorNode.js: “listen EADDRINUSE: address already in use”Find the process listening on the port and stop it. On macOS or Linux: lsof -nP -iTCP:3000 -sTCP:LISTEN, then kill the PID of the process that is listening. On Windows: netstat -ano | findstr LISTENING | findstr ":3000 ", then taskkill /PID <pid>. Or start your server on a free port (macOS/Linux: PORT=3001 node server.js). If it keeps coming back, a watcher such as nodemon is starting a second copy, or the old process is not closing on restart.
- JavaScript errorTypeError: “Cannot read properties of undefined (reading 'x')”Open the stack trace at the first line in your own code and look at what comes before .name on that line: that value is missing. Usually the data has not loaded yet (the first render runs before the fetch finishes), the API returned a different shape than the code expects, or an array index or find() came back empty. Guard it with optional chaining (user?.name), a default (data ?? []), or an early return until the data is there. Firefox says can't access property "name", user is undefined, and Safari says undefined is not an object (evaluating 'user.name'), for the same problem.
- JavaScript errorTypeError: “x is not a function”Look at the name in the message. For x.map is not a function, x is not an array: log it, and if it is an object from an API, use the array inside it (data.items.map) or Object.values(x). For a typo, check the exact spelling and case (getElementById, not getElementByID). For something you imported, check default versus named imports: import helpers from './helpers' and import { helpers } from './helpers' are different. If you forgot await, x is a Promise, which has no map: await it first. For this.x is not a function, this is a different object than you expect (a jQuery or event callback, a plain function inside a method): use an arrow function or bind it. If this is undefined, the error reads "Cannot read properties of undefined" instead.
- JavaScript and API errorSyntaxError: “Unexpected token < in JSON at position 0”Open the Network tab, click the failing request and look at the response: it will be an HTML page. If it is your site’s index.html, the URL is wrong or a single-page app rewrite catches /api routes before your API does. If it is a 404, 500 or login page, fix that first. In code, check res.ok and the content-type before calling res.json(), and log await res.text() when it fails so you can see what came back.
- React errorReact: “Maximum update depth exceeded”Find the useEffect (or componentDidUpdate) that calls a setter. If it has no dependency array, it runs after every render: add one. If a dependency is an object, array or function created during render, it is new every time: depend on a primitive value instead, move it inside the effect, or memoize it. If the state can be computed from props or other state, delete the effect and calculate it during render. In a class component, onClick={this.setState({ open: true })} runs during render and loops the same way: pass a function instead. (In a function component, onClick={setOpen(true)} gives "Too many re-renders" instead.)
- JavaScript error“Uncaught (in promise)” and unhandled promise rejectionsFix the error that follows the prefix first, then make sure every async call has a handler: wrap await in try/catch, add .catch() to promise chains, and return promises from then() callbacks so their errors reach the catch at the end. In React, catch inside the async function you call from useEffect or an event handler and set an error state. In Node.js 15 and later an unhandled rejection crashes the process by default, so add the missing catch rather than silencing it.
- Node.js and network error“connect ECONNREFUSED” (and ERR_CONNECTION_REFUSED)Read the address and port in the error, then check something is running there: the database, Redis, your API or the dev server. If it is running, the host is wrong for where the code runs: inside Docker, localhost is the container itself, so use the service name from docker-compose (db:5432) or host.docker.internal. On Node.js 17 or 18, an error showing ::1 can mean localhost resolved to IPv6 while the server listens on IPv4 only: use 127.0.0.1 or make the server listen on both. On a host like Vercel, localhost never works: use the real database URL.
- React errorReact: “Objects are not valid as a React child”Find the {value} in JSX that holds an object, using the keys in the message. Render one of its fields ({user.name}), map an array of objects to elements, format a Date ({date.toLocaleDateString()}), or show JSON while debugging ({JSON.stringify(data)}). If the keys are $$typeof, type, props and similar, a React element is being passed where a value was expected, or two copies of React are installed (check npm ls react). If the message says [object Promise], an async function or component is being rendered where its result was expected: await the data first. API error objects ({ message, code }) cause it too: render error.message.
- Node.js errorNode.js: “Error [ERR_REQUIRE_ESM]: require() of ES Module ... not supported”Upgrade to Node.js 20.19 or 22.12 or later, where require() can load ES modules that have no top-level await (a default export then sits at .default). If you can’t upgrade, load the package with await import('pkg') inside an async function, switch your project to ES modules ("type": "module"), or pin the last CommonJS version (node-fetch@2, chalk@4). If the error comes from a tool such as Jest or ts-node, configure that tool for ES modules, because it may still use the old loader.
- Node.js and Express errorExpress: “Cannot GET /path”Check that a route exists for that exact method and path: app.get('/') for the home page, and a GET route if you typed the URL into the browser, because browsers only send GET. If you serve a front end, point express.static at the right folder with path.join(__dirname, 'public') and make sure index.html is inside it. For a React, Vue or Vite app, add a fallback after your API routes that sends index.html for other GET requests, so refreshing a client route works.
- TypeScript errorTypeScript: “Property 'x' does not exist on type 'Y'” (TS2339)Look at the type named in the message. If it is your own interface, add the property (optional with ? if it is not always there). If it is a union such as Cat | Dog, check which one you have first with 'meow' in pet or typeof before reading the property. If it is {} or never, the variable was typed from an empty initial value: give it a real type, such as useState<User | null>(null). For window.x or Express’s req.user, add the property with a global or module augmentation. Avoid casting to any, which hides real bugs.
- JavaScript and Node.js errorReferenceError: “require is not defined”In a Node.js ES module, replace require() with import, and __dirname with import.meta.dirname (Node.js 20.11 and later). If one package really needs require, create it with createRequire(import.meta.url). In the browser, use import and a bundler such as Vite, or a script tag, because the browser has no require. If the whole project should be CommonJS, remove "type": "module" from package.json or rename the file to .cjs.
- npm and Node.js errornpm: “EACCES: permission denied”For global installs, reinstall Node.js with a version manager such as nvm, fnm or Volta, so global packages go into your home folder. Or point npm’s global folder at a folder you own with npm config set prefix ~/.local and add ~/.local/bin to your PATH. Don’t fix it with sudo npm install -g, which creates more root-owned files. If a normal install in a project fails, root-owned files in the project or in ~/.npm are the cause: change their owner back to your user.
- TypeScript errorTypeScript: “Type 'X' is not assignable to type 'Y'” (TS2322)Read the error from the bottom: the last indented line names the exact property or value that does not fit. If the mismatch is undefined or null, handle that case first (a check, a default with ??, or an optional type). If a string should be one of a few values, type it as that union from the start, or add as const to the literal. If an object is missing a property, add it or make the target property optional. Use an as cast only when you know something TypeScript cannot, because a wrong cast hides a real bug.
- TypeScript errorTypeScript: “Cannot find name 'x'” (TS2304, TS2580, TS2582, TS2591)Install the type package for the environment: npm install --save-dev @types/node for process, require, Buffer and __dirname, and the test runner’s types (@types/jest, or vitest/globals) for describe and it. Then check tsconfig.json: from TypeScript 6.0, types defaults to an empty list, so add "node" (and your test runner) to it; on older versions a types array also limits which @types packages load; and "lib" needs "DOM" for document and window. For your own variable or a library export, the fix is an import or a typo.
- Node.js errorNode.js: “Error: read ECONNRESET” / “socket hang up”Work out which connection was reset: an outgoing request to an API or database, or requests into your server. For outgoing calls, retry idempotent requests (GET, and anything with an idempotency key) with a short backoff, and add a timeout. For your own server behind a load balancer or proxy, set server.keepAliveTimeout longer than the proxy’s idle timeout, so Node.js never closes a connection the proxy is about to reuse. Always handle the error event on sockets and streams, or one reset crashes the process.
- Node.js and Express errorError [ERR_HTTP_HEADERS_SENT]: “Cannot set headers after they are sent to the client”Find the second response in the stack trace and make every response the last thing that path does: write return res.status(400).json(...) instead of res.status(400).json(...) followed by more code. Don’t call next() after sending a response. In callbacks, loops and try/catch blocks, check that only one branch can send. In a custom error handler, check res.headersSent and pass the error to next(err) if a response has already started.
- JavaScript and API errorAxiosError: “Network Error” (ERR_NETWORK)Open the browser’s Network tab and console: a CORS message there means the API must send Access-Control-Allow-Origin for your site. If your page is on HTTPS and the API URL starts with http://, the browser blocks it as mixed content: use HTTPS for the API. On a phone or emulator, localhost is the device itself, so use your computer’s LAN address (or 10.0.2.2 on the Android emulator) and allow cleartext only for development. Also check the API URL and that the server is running and reachable.
- JavaScript and API errorTypeError: “Failed to fetch”Check the console next to the error: a CORS message means the server must allow your origin. An http:// URL from an https:// page is blocked as mixed content. Also check that the URL is right and complete, the server is up, the user is online, and no ad blocker or browser extension is blocking the request (common for URLs with words like analytics or track). For real network drops, catch the error and show a retry instead of a blank screen.
- JavaScript errorSyntaxError: “Unexpected end of JSON input”Check the response before parsing it. If res.status is 204 or the body is empty, don’t call res.json(). If res.ok is false, read res.text() and log it, because error responses are often empty or not JSON. For JSON.parse, guard against empty strings, and handle null from localStorage. If the body is cut off part-way, the server crashed or timed out mid-response: check its logs.
- Node.js errorFATAL ERROR: “Reached heap limit Allocation failed: JavaScript heap out of memory”For a one-off build, raise the limit with NODE_OPTIONS=--max-old-space-size=4096 (in MiB), and keep it below the machine’s or container’s memory. In CI and Docker, check the runner really has that much RAM. For a server that grows until it crashes, raising the limit only delays the crash: take heap snapshots and look for caches, arrays or listeners that only grow. Also stop loading whole files or query results into memory at once: stream or page them.
- JavaScript errorRangeError: “Maximum call stack size exceeded”Open the stack trace: the same function name repeating over and over is the loop. Give recursion a base case that is always reached. Check setters and getters that read or assign their own property (set name(v) { this.name = v } calls itself). Check two functions or event handlers that call each other. For very deep data, use a loop instead of recursion. And don’t spread huge arrays into function arguments (Math.max(...bigArray), arr.push(...other)), which can hit the same limit.
- JavaScript errorSyntaxError: “Unexpected identifier”Go to the line and column in the error, then look at what comes just before the named identifier: that is usually where the mistake is. The common ones are a missing comma between object properties or array items, a missing + or other operator between values, a misspelled keyword (funtion, retrun, cosnt), and an unclosed bracket or quote on an earlier line. If the name is after type or interface, the file contains TypeScript but is being run as JavaScript.
- Build errorwebpack: “Module parse failed: Unexpected token. You may need an appropriate loader to handle this file type”Look at the file path in the message. For .css, .scss, .ts, .tsx or .jsx files, add a module rule that sends that extension to the right loader (css-loader with style-loader, sass-loader, ts-loader or babel-loader). For images, fonts and SVG on webpack 5, add an asset rule (type: 'asset/resource') instead of an old file-loader. If the path is inside node_modules, the package ships syntax your build does not transpile: include that package in your babel-loader rule, or upgrade the build tool.
- JavaScript errorTypeError: “Converting circular structure to JSON”Read the constructor name in the message: it tells you what got into the data. Usually it is a whole request or response object, an Axios error, a DOM element, a React event, or a database document with back-references. Send or store only the plain fields you need instead of the whole object. For logging in Node.js, use console.log or util.inspect, which handle cycles. If you really need to serialize a cyclic object, pass a replacer that skips repeated references.
- JavaScript errorTypeError: “x is not a constructor”Log the value right before new: console.log(typeof Something, Something). If it is an object with a default or a named key, you imported the module object instead of the class: switch between import Something from and import { Something } from, or use .default when loading an ES module through require. If it is undefined, the export name is wrong. If it is a function, it may be an arrow function or a factory that must be called without new.
- JavaScript errorJavaScript: “Invalid Date” / “RangeError: Invalid time value”Log the exact value passed to new Date(). Pass ISO 8601 strings (2026-12-31 or 2026-12-31T10:00:00Z), not local formats such as 31-12-2026 or 31/12/2026, which are invalid or parsed by browser-specific rules. Guard against undefined and empty values before creating the date. Check validity with Number.isNaN(date.getTime()) before calling toISOString() or formatting it. For other formats, parse the parts yourself or use a date library’s explicit format parser.
- JavaScript errorTypeError: “Cannot destructure property 'x' of 'y' as it is undefined”Find what is undefined: the name after of in the message. For a function parameter the message names 'undefined' itself, so look at the call site. If it is a function parameter, the function was called without that argument: give it a default, function f({ a } = {}). If it is data from an API, a hook or a database, it has not loaded or the field is missing: check it first, or use const { a } = value ?? {}. Note that a default value does not apply when the value is null, only when it is undefined.
- JavaScript errorSyntaxError: “Invalid or unexpected token”Go to the line and column in the error and retype the quotes and dashes on it by hand. Code pasted from a document, a chat app or a web page often brings curly quotes, long dashes or zero-width spaces with it. Search the file for any non-ASCII character with the regex [^\x00-\x7F] in your editor. Also look for a single- or double-quoted string that runs onto the next line: use a template literal for multi-line text.
- JavaScript errorSyntaxError: “missing ) after argument list”Look inside the function call on the reported line. The usual causes are two values with no + or comma between them (console.log('Total: ' total)), a quote inside a string that ends the string early ('it's'), a missing comma between arguments, or a bracket or brace opened inside the call and never closed. Template literals avoid most quoting and concatenation mistakes: console.log(`Total: ${total}`).
- JavaScript and API errorAxiosError: “Request failed with status code 4xx / 5xx”Log error.response.status and error.response.data: the body often names the exact problem. 400 or 422 means the request data is wrong (missing field, wrong format). 401 means no valid credentials: the token is missing, expired or sent in the wrong header. 403 means the user is known but not allowed. 404 means the URL or base URL is wrong, or the record does not exist. 5xx means the server failed: check the server logs at that time, not the client code.
- JavaScript errorTypeError: “Cannot convert undefined or null to object”Find the Object.keys, Object.entries, Object.values or Object.assign call in the stack trace and log the value passed to it. Give it a fallback, Object.keys(data ?? {}), or return early until the data exists. For Object.assign, the first argument (the target) must be an object: use Object.assign({}, a, b) or the spread syntax { ...a, ...b }, which skips undefined and null without throwing.
- JavaScript and build errorReferenceError: “process is not defined”In a Vite app, read env variables from import.meta.env, and name the ones the browser needs with the VITE_ prefix. In Next.js, browser code can only read variables named NEXT_PUBLIC_, which are inlined at build time. With webpack 5, replace the values you use with DefinePlugin. If the error comes from a library inside node_modules, it was written for Node.js: look for its browser build, or define the one value it reads.
- Node.js and npm errorNode.js / npm: “self-signed certificate in certificate chain”Get your company’s root certificate as a PEM file from IT, then point Node.js at it with NODE_EXTRA_CA_CERTS=/path/company-ca.pem (npm runs on Node.js, so this covers npm install too). It is read when the process starts, so set it in the shell or CI environment, not inside your script. On Node.js 22.15 or newer, --use-system-ca makes Node.js trust the certificates your operating system already trusts. For your own local HTTPS server, use a locally trusted CA (for example with mkcert) instead of a raw self-signed certificate. Do not set NODE_TLS_REJECT_UNAUTHORIZED=0 or strict-ssl=false.
- npm and Node.js errornpm install: “gyp ERR! build error” / “gyp ERR! find Python”Find which package is building (its name is in the lines above gyp ERR!). If it is an old package such as node-sass or an outdated bcrypt or sqlite3, upgrading it or switching to a pure JavaScript alternative (sass, bcryptjs) is often the real fix. Otherwise install the build tools: Xcode Command Line Tools on macOS (xcode-select --install), Python, make and a C++ compiler on Linux, and Python plus Visual Studio’s C++ build tools on Windows. With Python 3.12 or newer, node-gyp must be version 10 or later.
- Node.js errorNode.js: “Error: getaddrinfo ENOTFOUND hostname”Read the hostname at the end of the message. If it says undefined, an environment variable is not set. If it contains https:// or a path, a full URL was passed where only a hostname belongs. Otherwise check the spelling, then resolve the name with Node.js itself from the same machine or container. If the name is a Docker Compose service such as db, it only exists inside the Compose network, so from your machine use localhost and the published port. Inside a company network, check that the VPN or DNS can resolve the name.
- Node.js errorNode.js: “Error: connect ETIMEDOUT” / “read ETIMEDOUT”Check which kind it is. connect ETIMEDOUT means the connection was never set up: the host or port is wrong, a firewall drops the traffic, or a cloud database only accepts allowlisted IP addresses. Test the port from the same machine with nc -vz host port. read ETIMEDOUT means an open connection went silent, often an idle connection dropped by a load balancer or NAT. An AggregateError with one ETIMEDOUT per address means every address Node.js tried (IPv6 and IPv4) timed out; if the host works from elsewhere, a slow network or broken IPv6 is the usual cause, so raise the attempt timeout.
- npm and Node.js errornpm: “Error: EPERM: operation not permitted, rename / unlink”Stop everything that might hold files in the project open: the dev server, watchers, your editor’s TypeScript server, and other terminals. Then delete node_modules and run npm install again. If it keeps happening on Windows, exclude the project folder from antivirus scanning and move it out of a OneDrive or other synced folder. On macOS, give your terminal access to the folder (Desktop and Documents are protected). Do not reach for sudo or an administrator terminal first.
- npm and Node.js errorpnpm / npm: “ELIFECYCLE Command failed with exit code 1”Scroll up past the npm lines to the first error the script printed and fix that: a compile error, a failing test, a missing module. The exit code helps: 1 is a normal failure, 127 means the command was not found (run npm install, or the package that provides it is missing), and 137 means the process was killed, most often for running out of memory. During npm install, the failing script belongs to a dependency, so the package name in the message is the one to look at.
- JavaScript errorJavaScript: “TypeError: Cannot use 'in' operator to search for 'x' in y”Look at the value after in. If it is text that looks like JSON, parse it with JSON.parse (or fix the response so the library parses it). If it is undefined or null, the data has not arrived or the path is wrong, so guard before checking. If you meant to find a value in a string or array, use includes() instead; in only checks property names.
- Node.js errorNode.js: “TypeError [ERR_INVALID_ARG_TYPE]: The 'path' argument must be of type string”Read the last part of the message. Received undefined means a variable, environment variable or config value is not set; trace it back and set it, or fail early with a clear error. Received an instance of Object or a number means you passed the wrong thing (an object where a string or Buffer belongs, so stringify it). If the stack trace is inside a build tool such as an old react-scripts or webpack, the tool is too old for your Node.js version: upgrade it.
- Node.js errorNode.js: “Error: EMFILE: too many open files”If the message ends in watch, the file watcher is the problem: install Watchman (brew install watchman) for Jest and React Native, or exclude node_modules from the watcher. If it ends in open, your code opens too many files at once: limit how many run in parallel and make sure every file handle and stream is closed. Raising the limit with ulimit -n helps as a stopgap but does not fix a leak.
- Node.js and npm errorNode.js / npm: “Error: certificate has expired” (CERT_HAS_EXPIRED)Check the server certificate from the same machine (openssl s_client or curl -v). If it really expired, only the server owner can fix it by renewing. If it is valid, check the system clock, especially in containers and VMs. Then check what the client trusts: an old Node.js version, or a ca option or cafile pointing at an old certificate bundle, can still try a root certificate that has since expired. Upgrade Node.js and remove pinned bundles. Do not turn off verification.
- JavaScript errorJavaScript: “SyntaxError: await is only valid in async functions and the top level bodies of modules”Find the function that directly contains the await and add async to it. If the await is inside a callback such as forEach or map, that callback is the function that needs async, and forEach will not wait for it, so use a for...of loop or Promise.all instead. For await at the top level, run the file as an ES module: type="module" on the script tag in browsers, or .mjs or "type": "module" in package.json for Node.js.
- JavaScript errorJavaScript: “TypeError: x is not iterable”Log the value just before the line that throws. If it is a plain object, loop over Object.entries(obj) or Object.values(obj) instead. If it is a Promise, add await. If it is undefined, the data has not loaded or the property name is wrong, so default it (list ?? []) and fix where it comes from. For const [a, b] = something, check that something really returns an array, not an object.
- JavaScript errorJavaScript: “SyntaxError: Unexpected token 'export'”In the browser, load the file with script type="module". In Node.js, make the file an ES module: .mjs, or "type": "module" in package.json (or switch the file to module.exports if the project is CommonJS). In Jest, the file is usually a package in node_modules that ships only ES modules, which Jest does not transform by default: add it to transformIgnorePatterns as an exception, or use Jest’s ES module support. In Next.js, list the package in transpilePackages.
- npm errornpm: “ERESOLVE unable to resolve dependency tree”Read the Found and Could not resolve dependency lines: they name the package whose peer range is too old (or too new) for what you have. Upgrade that package to a release that supports your version, or pick versions that satisfy both ranges. If no compatible release exists and you have checked it works, pin the peer with overrides in package.json. Use --legacy-peer-deps only as a last resort, and never --force as a habit.
- Node.js errorNode.js: “Error [ERR_MODULE_NOT_FOUND]: Cannot find module ... imported from ...”If the message says Cannot find module with a path, add the file extension to the import (./utils.js); a bare directory import gives ERR_UNSUPPORTED_DIR_IMPORT instead and needs ./lib/index.js. In TypeScript with "module": "NodeNext", write the .js extension in the .ts source; the compiler keeps it. If it says Cannot find package, install it (and check it is in dependencies, not devDependencies, when production installs skip dev packages). On Linux servers, also check the letter case of the file name.
- TypeScript errorTypeScript: “Argument of type 'X' is not assignable to parameter of type 'Y'” (TS2345)Read the two types in the message. If the argument includes undefined or null, check for it before the call or give a default. If it is string where a set of literal strings is expected, keep the literal type with as const or a type annotation. If it is an object, the indented lines under the error name the property that is missing or has the wrong type. Avoid as casts that only silence the error: they move the crash to runtime.
- TypeScript errorTypeScript: “Parameter 'x' implicitly has an 'any' type” (TS7006, TS7016, TS7053)For a parameter, add a type annotation (or let it be inferred by passing the function where a typed callback is expected). For a module, install its types (npm install -D @types/name) or, if none exist, declare the module in a .d.ts file. For an index error, type the object as a Record or narrow the key with keyof typeof. Turning off noImplicitAny makes the message go away but removes the checking it gives you.
- TypeScript errorTypeScript: “Object is possibly 'null'” / “'x' is possibly 'undefined'”Handle the empty case before you use the value: an if check or an early return, optional chaining (el?.focus()) when doing nothing is fine, or ?? to fall back to a default. Use the non-null assertion (!) only when you know the value exists and TypeScript cannot see why. Do not turn strictNullChecks off; it is the check that catches Cannot read properties of null before your users do.
- TypeScript errorTypeScript: “No overload matches this call” (TS2769)Read the error under the overload you meant to call (if unsure, the one whose parameters look closest to your arguments); that inner message is the real problem. If an argument is a union (string or array, say), each overload accepts only one side, so narrow it first. If an argument might be undefined, handle that first; overloaded functions such as new Date() report it this way. If a library call that should work fails, check that its @types version matches the library version.
- JavaScript errorJavaScript: “ReferenceError: x is not defined”Check the exact spelling and letter case of the name first. Then check where it was declared: let and const only exist inside the block where they are declared, so a variable created inside an if or a function is not visible outside it. For library globals such as $ or gtag, make sure the script that defines them loads before your code. For require, process, window or document, the code is running in an environment that does not have them; see the related fixes below.
- JavaScript errorJavaScript: “ReferenceError: document is not defined”In Jest, set testEnvironment to jsdom (and install jest-environment-jsdom, which Jest 28 and later no longer bundle); in Vitest, set environment to jsdom or happy-dom. In a Node.js script that needs to read HTML, use a parser such as jsdom or cheerio instead of document. In Next.js, Nuxt or SvelteKit, move the DOM code into useEffect, onMounted or onMount so it only runs in the browser.
- JavaScript errorJavaScript: “ReferenceError: self is not defined”Find the file in the stack trace. If it is inside node_modules, that package is browser-only: import it only on the client (a dynamic import with ssr: false inside a Client Component in Next.js, or inside useEffect), or look for a server or Node.js build of it. If it is your own library, build it with output.globalObject set to 'this' or use globalThis. If it is your own code, replace self with globalThis.
- JavaScript error“TypeError: undefined is not an object (evaluating 'x.y')”Read the expression in brackets. In user.profile.name, the error means the part before the last dot (user.profile) was undefined. Find where that value comes from: usually data that has not loaded yet, an API response with a different shape, or an empty result from find() or an array index. Guard it with optional chaining (user.profile?.name) or a check, and render a loading state until the data arrives.
- JavaScript error“TypeError: Cannot assign to read only property 'x' of object”Do not change the object in place. Make a copy and change the copy: [...items].sort() instead of items.sort(), { ...user, name } instead of user.name = name. In Redux Toolkit, change state only inside a reducer, where Immer allows it. In React, never assign to props; lift the value into state in the parent and pass a setter down.
- JavaScript error“SyntaxError: Identifier 'x' has already been declared”Find the two declarations of the name in the message. If they are in the same block, rename one or drop the second let or const and assign to the first. If one is an import, rename the local variable or import with as. In a switch, wrap each case in braces. In the browser, if the file is fine, the same script is probably loaded twice, or two classic scripts declare the same top-level name.
- Node.js errornpm: “npm error Missing script: "start"”Run npm run with no name to list the scripts this package.json has, and use the name it shows (a Vite app has dev, not start). If the list is not what you expect, you are in the wrong folder: cd into the folder with the app’s package.json, or in a monorepo use npm run dev --workspace=packages/web (the folder path, or the name from that package.json). On a hosting platform, set the build command to a script that exists, or the root directory to the app’s folder.
- JavaScript error“SyntaxError: Invalid regular expression: /…/: Nothing to repeat”Look at the pattern in the message. If it came from user input or a filename, escape it before building the RegExp: RegExp.escape(text) in current browsers and recent Node.js, or a replace() fallback for older ones. If it is a form field’s pattern attribute, remember browsers compile it with the v flag, so a hyphen inside [ ] must be escaped as \- . For Invalid escape, remove backslashes that do not mean anything in u or v mode.
- JavaScript error“TypeError: Class constructor X cannot be invoked without 'new'”If the stack trace points at your code, add new: new User(data), not User(data), and use (x) => new Row(x) where a function is expected. If it points at compiled output and appeared after a package update, your build targets ES5 while the package now ships real classes: set "target" to "ES2017" or later in tsconfig.json.
- Node.js error“ReferenceError: exports is not defined”In Node.js, either rename the file to .cjs so it stays CommonJS, or convert it to export syntax. If the file is TypeScript output, set "module" to "nodenext" in tsconfig.json for Node.js, or "esnext" or "preserve" for code that a bundler or the browser loads. In the browser, never load CommonJS output with a plain script tag: bundle it, or emit ES modules and use type="module".
- Browser error“ResizeObserver loop completed with undelivered notifications”If it comes from your own ResizeObserver callback, stop the callback from changing the size it watches in the same frame: only update when the size really changed, or move the update into requestAnimationFrame. If it comes from a library and the layout is correct, update the library and filter the message out of the dev overlay, tests and error tracking; it is an error event on window, not an exception in your code.
AI connectors and AI APIs
- OpenAI API errorOpenAI API 429: insufficient_quotaRead error.code in the response, not only the 429 status. credit_balance_exhausted means add credits; organization_spend_limit_exceeded or project_spend_limit_exceeded means raise or remove that limit. organization_usage_limit_exceeded means OpenAI set the limit, so request a higher approved limit or contact support. If the code points to a rate limit instead, slow down and follow Retry-After. In your app, treat billing codes as non-retryable and alert yourself, so users don’t sit through retries that can’t succeed.
- Gemini API errorGemini API 429 RESOURCE_EXHAUSTED: which limit, and the fixA 429 from the Gemini API means the project went over one of its limits: requests or input tokens per minute, requests per day, or, for some accounts, a spend-based limit over a rolling 10 minutes. Limits apply per project, not per API key, so another key in the same project doesn’t help. Retry with exponential backoff and jitter, cut expensive requests, check your active limits in AI Studio, and request an increase if normal usage keeps hitting one.
- Anthropic API errorAnthropic API 529: overloaded_errorLet the official SDK retry with backoff, and raise max_retries if two retries aren’t enough for your traffic. Handle error events inside streams, since those arrive after a 200 response. Show users a clear retry message or queue the job instead of failing silently. A 429 at a sudden traffic jump is a different limit: ramp traffic up gradually.
- Claude custom connectorAuthorization with the MCP server failedWork from the outside in. First make sure Claude can reach the URL at all: a public address, no firewall or bot rule blocking Anthropic, and no redirect to another host. Then check the sign-in flow: an unauthenticated request must get a 401 that points to your OAuth metadata, your authorization server must support S256 PKCE and a way for Claude to register, and discovery, registration and token responses must each arrive within 10 seconds.
- ChatGPT MCP connectorChatGPT MCP connector: OAuth redirect or sign-in failsCopy the redirect URI from the MCP server’s page in ChatGPT and allowlist exactly that address on your authorization server. ChatGPT uses one of two addresses, depending on whether your authorization server supports issuer identification. Then check that your authorization server metadata advertises S256 PKCE and a way for ChatGPT to get a client ID: CIMD, dynamic client registration or a predefined client.
- MCP transport errorMCP server: 405 Method Not Allowed or 406 Not AcceptableServe one MCP endpoint that accepts POST and answers with JSON or an event stream. A 405 on GET is allowed by the spec for a server that doesn’t stream to the client, so only POST needs to work. A 406 comes from servers, often built on an SDK, that reject requests whose Accept header lacks application/json or text/event-stream. A 403 usually means your Origin or Host check rejected the request.
- OpenAI API errorOpenAI 401 “Incorrect API key provided” or “Invalid Authentication”Read the exact 401 message. For Incorrect API key provided, check the key for a typo or extra space, confirm it belongs to the right organization and project, and generate a new one if it was deleted. For Invalid Authentication, check the key and organization ID you send. For the membership message, get invited back to an organization.
- OpenAI API errorOpenAI: “context_length_exceeded”Count the tokens before you send, and keep each request inside the model’s context window, including the output you ask for. Send only the recent turns plus a short summary of older ones, split or retrieve parts of large documents instead of sending them whole, and lower the maximum output if it is set high. For long conversations on the Responses API, turn on compaction.
App Store rejections
Guide: App Store and Google Play rejections
- App Store rejectionGuideline 2.1 - Performance - App CompletenessTwo common causes of 2.1 rejections are a reviewer who couldn’t sign in and a build that crashed on their device. Add a demo account that works to the review notes, keep your back end running during review, and test the exact build on a real device before you resubmit.
- App Store rejectionGuideline 2.3 - Performance - Accurate MetadataGuideline 2.3 is about the listing, not the code: Apple wants the screenshots, previews, description and other metadata to match the app’s core experience. Common fixes are screenshots of the app in use rather than a splash or login screen, previews made only of screen captures, clear notes on what costs extra, and removing other platforms’ names and icons. Check which item the reviewer named, change it, then resubmit.
- App Store rejectionGuideline 4.3(a) - Design - SpamA 4.3 rejection means Apple sees your app as a copy: several near-identical apps under different Bundle IDs (4.3(a)), or an app indistinguishable from what’s already widely available (4.3(b)). The fix is usually a product change, such as merging the copies into one app, or making the app meaningfully different, not a code fix.
- App Store rejectionGuideline 5.1.1 - Legal - Privacy - Data Collection and StorageThe most common 5.1.1 rejections: no way to delete an account inside the app (5.1.1(v)), purpose strings that don’t explain why the app needs a permission (5.1.1(ii)), a missing privacy policy link (5.1.1(i)), or a permission demanded before the user can do something unrelated (5.1.1(iv)). Each is a fixable change in the app or its listing.
- App Store rejectionGuideline 4.2 - Design - Minimum FunctionalityA 4.2 rejection means Apple sees the app as a repackaged website, or not useful or app-like enough. The rule doesn’t ban web views; it asks for features, content and UI beyond the website. The fix is a product change: give people a reason to install it, shown clearly in the build and the review notes.
- App Store rejectionGuideline 3.1.1 - Business - Payments - In-App PurchaseIf people pay to unlock something inside the app, such as a subscription, premium content or credits, Apple requires in-app purchase. Physical goods and services used outside the app must use another payment method, such as Stripe or Apple Pay. Links to buy on your website are allowed in United States storefront apps; elsewhere they generally need one of Apple’s entitlements.
- App Store rejectionGuideline 3.1.2 - Business - Payments - SubscriptionsApple lists what a subscription sign-up screen must include: the subscription’s name and length, what people get during it, the full renewal price shown clearly, and a way to sign in or restore purchases. Your app and App Store metadata must also link to your Terms of Use and Privacy Policy, and the amount billed must be the most prominent price. Check which clause the rejection quotes first: 3.1.2(a) is about the subscription itself, not the screen.
- App Store rejectionGuideline 4.8 - Design - Login ServicesIf the main account in your app is set up through a third-party or social login, Apple requires an equivalent option from another login service that limits data to name and email, lets people keep their email private, and doesn’t collect app activity for ads without consent. The guideline names no service; it lists the features. Apps that only use their own email and password sign-in don’t need it.
- App Store Connect upload errorApp Store Connect: “ITMS-90725: SDK version issue”Build with Xcode 26 or later, which uses the iOS 26 SDK. Check with xcodebuild -version on the machine that makes the build, and on Codemagic, GitHub Actions, Bitrise or EAS pick an image with Xcode 26. Then increase the build number and upload again. Plan for the next step too: Apple says uploads need the iOS 27 SDK starting April 2027.
- App Store Connect upload errorApp Store Connect: “ITMS-91053: Missing API declaration”Find which code uses the API named in the email. If it is your own code, add a PrivacyInfo.xcprivacy file to the app target in Xcode and list the API category with an approved reason under NSPrivacyAccessedAPITypes. If it is a third-party SDK, update it to a version that ships its own privacy manifest. Then rebuild and upload.
- App Store Connect upload errorApp Store Connect: “ITMS-90683: Missing purpose string in Info.plist”Read the key names in the email. For each one (NSCameraUsageDescription, NSMicrophoneUsageDescription, NSPhotoLibraryUsageDescription, NSLocationWhenInUseUsageDescription, NSContactsUsageDescription and so on), add that key to the app target’s Info.plist, or in Xcode under the target’s Info tab, with one plain sentence saying what the app does with the access, then upload a new build. If the app never uses that resource, the code that touches it is usually inside a plugin or SDK: remove or replace that dependency, or add an honest purpose string anyway.
Google Play launches
Guide: App Store and Google Play rejections
- Google Play production accessNew Google Play accounts need 12 testers for 14 days before going liveFinish your app setup, start a closed test and get at least 12 testers opted in. Keep them opted in for 14 days in a row, collect their feedback, then click Apply for production on the Play Console dashboard and answer the questions about your test. Google says its review usually takes seven days or less.
- Google Play policy issueGoogle Play rejected my app over the Data safety form. What do I fix?Google reviews the Data safety form with the app, and you alone are responsible for it being complete and accurate. List every kind of user data the app and its SDKs (third-party code libraries built into the app) collect or share, and answer the security questions truthfully. Link a working privacy policy, and if users can create an account, offer account deletion in the app and on the web. Then update the form and resubmit.
- Google Play policy issueGoogle Play rejected my app over Photo and Video Permissions. What do I fix?If your app targets Android 13 or later, it may only request READ_MEDIA_IMAGES and READ_MEDIA_VIDEO when a system picker such as the Android photo picker isn’t enough for its core functionality, as with a gallery app. If people only choose a photo or video to attach or upload, switch to the photo picker and remove both permissions. If a library adds them, remove them in your manifest with tools:node="remove". If the app really needs broad access, submit the declaration in Play Console.
- Google Play policy issueGoogle Play rejected my app over foreground service permissions. What do I fix?If your app targets Android 14 or later, declare every foreground service type it uses on the App content page in Play Console, with a description, the effect of delays or interruptions on users, the use case, and a link to a video of a user triggering the feature. In the manifest, give each service its type and the matching permission. If a task fits no type, Android recommends WorkManager or a user-initiated data transfer job instead.
- Google Play upload errorGoogle Play: “You need to use a different version code for your APK or Android App Bundle”Raise versionCode above every build you’ve uploaded before, rebuild and upload again. In Flutter, versionCode is the build number after the + in pubspec.yaml’s version line, so change 1.0.0+1 to 1.0.0+2. If your build script passes --build-number, change it there instead.
- Google Play upload errorGoogle Play: “Your Android App Bundle is signed with the wrong key”Sign the bundle with the upload key Play Console expects. Compare the upload key certificate on the Play app signing page in Play Console with your keystores to find the right one. If it’s lost, create a new upload key, export its certificate, and request an upload key reset in Play Console. Google keeps the app signing key, so users keep getting updates.
- Google Play requirementGoogle Play: app must target API level 35 or 36Set targetSdk (and compileSdk) to 36 in the app’s Gradle file, build, and test the screens that Android 15 and 16 change, then upload the new version. An app that doesn’t ship an update needs at least API level 35 to stay available to new users on newer Android versions. In Flutter, Expo or React Native, change it where the project sets the Android SDK versions, then check the built bundle.
- Google Play policy issueGoogle Play Console warning: your app uses an unsupported Google Play Billing Library versionFind the billing dependency in your Android build (com.android.billingclient:billing, or the version pulled in by a plugin such as in_app_purchase or RevenueCat), and move it to version 8 or later. Version 9 is the newest in Google’s table, and its migration guide is linked below. Build, upload, and check that the warning clears. If you already upgraded and the warning stays, check that the merged AndroidManifest.xml contains com.google.android.play.billingclient.version.
Moving and upgrading apps
- Lovable Cloud moveMove your Lovable app off Lovable Cloud to your own SupabaseExport the database from Lovable (it includes your users and their password hashes) and restore it into your own Supabase project. Then move storage files, edge functions, secrets and sign-in settings by hand, and switch the app over. Anyone signed in at the switch signs in once more. Keep the built-in backend until the new project works, because removing it can’t be undone.
- Leaving BoltMove your Bolt app off Bolt without breaking itDownload a copy, then connect a GitHub repository so the code lives in an account you own. Move the database by claiming your Bolt Database in Supabase, which needs a Pro or Teams plan and a Supabase org owner, rather than connecting a fresh Supabase database, which can lose data. Deploy the repository to your new host, add the environment variables there, and move the custom domain. Then test sign-in, emails, payments and webhooks before you switch users over.
- Lovable and Bolt to iOSTurn your Lovable or Bolt web app into an App Store appWrap the published web app in a native shell with Capacitor, build it in Xcode on a Mac, and submit it from your own Apple developer account. To pass review it has to be more than your website in a frame: plan native features such as push notifications, add Sign in with Apple if Google sign-in is the only option, and let users delete their account in the app.
- Framer and Webflow to an appAdd a real app to your Framer or Webflow siteKeep the marketing site where it is and build the app as a separate web app on a subdomain such as app.yourdomain.com, with its own sign-in, database and payments, linked from the site’s menu and buttons. Framer doesn’t offer an HTML export, and Webflow’s export leaves out the CMS, forms and user accounts, so moving the site rarely pays.
Not listed? Send the error
Email the full error text and what you were doing when it appeared to simon@app369.com. Simon replies by email, usually within one business day.
A different error?
Describe it and get a written quote
Send the error and what you were doing. You get a written scope, a fixed price and a timeline; Simon replies by email, usually within one business day.