What a quick click-through skips
Where each bug below hides:
| What a click-through skips | The bug that hides there |
|---|---|
| A slow or failing network | No loading or error state |
| A second click or a retry | The same row saved twice |
| Fast clicks between items | Old data shown over new |
| Requests sent without your screens | Rules checked only in the browser, open tables |
| A look at the JavaScript | Secret keys in the bundle |
| A new account with empty fields | undefined, NaN, [object Object] |
| A phone 360 px wide | Sideways scrolling, covered buttons |
1. No loading state and no error state
On your machine the API answers fast, so you rarely see the waiting or failed screen. Columbia University's DAPLab vibe-coded more than 15 apps with five coding agents and lists error handling among nine failure patterns. In its example, an AI summary request failed on the server, the code logged the error to the console, and the screen kept saying "Generating…" (DAPLab). And fetch() does not reject on an error status such as 404 or 500, so check res.ok (MDN).
In Chrome DevTools, pick 3G in the Network panel's throttling menu (Chrome docs), right-click a request to your API and choose Block request (Chrome docs), then use every screen. Each one needs a loading state, an error you can retry and a time limit:
async function loadProjects() {
setState({ status: "loading" });
try {
const res = await fetch("/api/projects", { signal: AbortSignal.timeout(15000) });
if (!res.ok) throw new Error(`HTTP ${res.status}`); // fetch resolves on 404 and 500
setState({ status: "done", projects: await res.json() });
} catch (err) {
setState({ status: "error", message: "Could not load your projects. Try again." });
}
}
More: fetch that never resolves.
2. Double submits
Users double-click, tap again when nothing seems to happen, or retry after a lost response, and every request inserts a row without an error. Disable the button while the request runs, and give each submission an id the database refuses to store twice. On Supabase a unique column does it: the repeat fails with Postgres error 23505 (PostgREST docs), which the app treats as already saved.
alter table public.orders add column request_id uuid unique;
const requestId = crypto.randomUUID(); // once, when the checkout form opens
async function placeOrder(button, order) {
button.disabled = true;
showStatus("Placing order…");
try {
const { error } = await supabase
.from("orders")
.insert({ ...order, request_id: requestId });
if (error && error.code !== "23505") throw error; // 23505: already saved
showStatus("Order placed");
} catch (err) {
showStatus("Could not place the order. Try again.");
} finally {
button.disabled = false;
}
}
The id is made when the form opens, so a retry carries the same one. All the layers: preventing duplicate submissions.
3. Stale data after fast clicks
Click project A, then project B before A has loaded. If A's answer arrives last, the page shows A's data under B's name. The React docs warn that network responses may arrive in a different order than you sent them (React docs). In a click-through you wait for each page, so the order never flips. Show an answer only if it is still the latest:
let latest = 0;
async function openProject(id) {
const mine = ++latest;
const { data } = await supabase.from("projects").select("*").eq("id", id).single();
if (mine === latest) render(data); // drop a late answer for a project the user left
}
See the race condition simulator and out-of-order responses.
4. Checks that only run in the browser
A rule in front-end code binds only people who use your screens: a hidden admin page, a Create button switched off at the free plan's limit, a price worked out in the cart. Anyone can send the request without the screen, and MDN warns that client-side validation is too easy to bypass (MDN).
To test a rule, copy its request in the Network panel with Copy as fetch (Chrome docs), change the price, user id or plan, and run it in the Console: the server should refuse it. Put each rule where the request lands, in your API route or, on Supabase, in a Row Level Security policy. For payments, send product ids and let the server look up prices.
5. Secret keys in the browser bundle
Vite puts variables that start with VITE_ into client code (Vite docs), and Next.js inlines NEXT_PUBLIC_ ones into browser JavaScript (Next.js docs). A secret key behind either prefix, or pasted into a component, works and is readable by anyone who opens the site. Stripe says only publishable keys are safe to expose (Stripe docs); Supabase (Supabase docs) and OpenAI (OpenAI) say never to put secret keys in a browser. List the names your build can expose:
# names only, so no value lands on your screen
grep -hoE "^(VITE|NEXT_PUBLIC)_[A-Za-z0-9_]+" .env* | sort -u
On the live site, press Ctrl+Shift+F (Cmd+Option+F on a Mac) in DevTools to search all loaded files (Chrome docs) for the last ten characters of each secret key. Move every call that needs one into server code, then rotate the key.
6. Supabase tables without Row Level Security
A Supabase app's publishable key (or the legacy anon key) is public by design and reaches only what Row Level Security allows (Supabase docs). Supabase says to enable RLS on every table in an exposed schema; without it, any role with a grant can read and write the table (Supabase docs). Your app asks only for your rows, so the screen looks private while the API would answer anyone. Ask as a stranger would:
curl "https://<project-ref>.supabase.co/rest/v1/orders?select=*" \
-H "apikey: <publishable-key>"
You want an empty list or only public rows. Supabase's Security Advisor also flags public tables without RLS (Supabase docs). Turn RLS on and add policies, as in Supabase's examples:
alter table public.orders enable row level security;
create policy "Users read their own orders"
on public.orders for select
to authenticated
using ( (select auth.uid()) = user_id );
create policy "Users create their own orders"
on public.orders for insert
to authenticated
with check ( (select auth.uid()) = user_id );
Then sign in as a second test user and try to open the first user's records.
7. undefined, NaN and [object Object] on the page
Your test account has every field filled in; a new account has gaps. JavaScript prints a missing value like this:
`Hi ${user.name}` // "Hi undefined"
`$${(item.price * qty).toFixed(2)}` // "$NaN"
`Plan: ${plan}` // "Plan: [object Object]"
new Date(order.shippedAt).toLocaleDateString() // "Invalid Date"
A null from the database prints "Hi null", "$0.00" or a date around 1 January 1970 instead. Sign up as a new user, skip the optional fields, and search each page for these values. Print a fallback such as "Not set", and print plan.name, never the object. More: where each one comes from.
8. Layouts that break on phones
On a laptop you never see the page 360 px wide. At that width, one element wider than the screen makes the page scroll sideways, a fixed bar can cover a button, and without a viewport meta tag the phone lays the page out wider, for example at 980 px, then shrinks it (MDN). Check every page at 360 px in DevTools' device toolbar, then see horizontal scroll on mobile and button does nothing.
Checklist before launch
- Throttle to 3G and block the API: each screen shows loading, then an error you can retry.
- Double-click every button that saves, pays (in test mode) or sends: it happens once.
- Click fast between items and filters: the page ends on your last pick.
- Replay a request with a changed price, user id or plan: the server refuses it.
- Query each Supabase table with only the publishable key: nothing private comes back.
- Search the live site's files for each secret key: no match.
- Sign up with empty fields: no undefined, null, NaN,
[object Object],Invalid Dateor date around 1970. - Load every page 360 px wide: no sideways scroll, every button in reach.
Where GenClass fits
GenClass's free page check loads a public page as a desktop and a phone and scores it in eight categories. Its Phone category reports sideways scrolling at 390, 360 and 320 px and a missing viewport tag. Visual bugs includes text-template-leak, which reports text such as [object Object] or $NaN. Races double-clicks the most prominent submit button of a same-origin POST form while GenClass watches, skipping forms with a password or card field. Signed out, you see the three worst findings in full; a free account shows all of them. It never signs in and does not test Row Level Security, server-side checks or keys in your code. Run it on your launch page before you share the link.
If your Bolt.new or older Lovable project is React + Vite, or your v0 project is Next.js, add GenClass the same way as any app on that framework. GenClass has not tested projects from these builders. npx genclass adds the runtime in observe mode, the default. It reports double submits and stale responses from real visits without acting on them. It sees stale responses only in state it can find, such as React state, and misses many of both (measured rates).
For coding agents, the MCP server is set up for Claude Code, Cursor, Codex, Windsurf and Gemini CLI. It works on your development build, not the live site.
Questions
Is AI-generated code safe for production?
Only after you review it and test it like code you wrote yourself. Several of these bugs only show while the app runs, so reading the code is not enough.
Is the Supabase anon key safe to expose?
Yes, the anon or publishable key is meant for the browser, as long as Row Level Security is on for every table in an exposed schema. Secret and service_role keys bypass RLS and must stay on the server.
Why does my app save the same row twice?
A second click, a retry after a lost response or an effect that runs twice sends the insert again. Disable the button while it runs, and store a unique id per submission.
How do I test an AI-built app before launch?
Test what a click-through skips: a failing network, double and fast clicks, a 360 px screen, a new account, a second user and requests sent without your screens.
Related: front-end bugs that raise no error.