Core Web Vitals for AI-built sites punish pretty demos that never met a Lighthouse tab. Lovable exports ship hero images at full camera resolution. Cursor-generated Next.js apps load every font weight. INP spikes when hydration fights a dozen useEffect hooks. You do not need a rewrite — you need targeted fixes aligned to what Google measures: LCP, CLS, and INP. This guide maps each metric to vibe-coding failure modes and fix patterns you can prompt into an afternoon. Updated December 2026.

Deploy first with deploy to Vercel, then measure. Pair with analytics and Search Console so field data in CrUX matches your lab fixes. For image-heavy apps, see file uploads with Supabase Storage — user content destroys CWV without transforms.
Table of contents
- What Core Web Vitals measure in 2026
- Diagnose before you optimize
- LCP, CLS, INP fix table
- LCP fixes for AI hero sections
- CLS fixes for AI layouts
- INP fixes for AI interactivity
- Next.js patterns that preserve wins
- FAQ
What Core Web Vitals measure in 2026
Largest Contentful Paint (LCP) — time until the largest visible content element renders (usually hero image or H1 block). Good: ≤2.5s. Cumulative Layout Shift (CLS) — visual stability; elements jumping as fonts and ads load. Good: ≤0.1. Interaction to Next Paint (INP) — responsiveness to taps and clicks across the session. Good: ≤200ms. AI codegen optimizes for visual completeness in dev, not measured paint on 4G.
Search ranking correlation is nuanced, but user bounce is not — slow LCP and janky INP kill conversions on vibe-coded landing pages and SaaS dashboards alike.
Diagnose before you optimize
- Run Lighthouse mobile on production URL — not localhost
- Chrome DevTools Performance → record load and one button click
- Search Console → Experience → Core Web Vitals for field data
- Vercel Speed Insights or web-vitals RUM snippet for real users
Fix the metric failing in field data first. Lab-only green scores while CrUX is red means your users differ from your MacBook on fiber.
LCP, CLS, INP fix table
| Metric | Common AI-built cause | Fix (prompt-ready) | Verify |
|---|---|---|---|
| LCP | Unoptimized hero img 4000px, no priority | next/image with priority, sizes, WebP/AVIF, width 1600 max | LCP element <2.5s mobile lab |
| LCP | Render-blocking CSS/JS bundle | Dynamic import below-fold components; font-display swap | Network waterfall shorter critical path |
| LCP | Slow TTFB on server components | Cache static shell; edge cache public pages; fix N+1 queries | TTFB <800ms on marketing pages |
| CLS | Images without width/height | Explicit dimensions or aspect-ratio CSS on all img | CLS <0.1 on slow 3G throttle |
| CLS | Web fonts FOIT/FOUT | next/font local subset; fallback metric-matched stack | No text jump in filmstrip |
| CLS | Banners, toasts, ads injecting height | Reserve min-height slot; animate opacity not layout | Layout shift entries empty in trace |
| INP | Heavy click handlers on main thread | Defer non-urgent work; startTransition for UI updates | INP p75 <200ms in CrUX |
| INP | Hydration mismatch re-render | Fix suppressHydrationWarning misuse; client-only widgets dynamic ssr:false | No long tasks after click |
| INP | Third-party scripts (analytics, chat) | Load after idle; partytown or defer GTM | INP improves when scripts removed A/B |

LCP fixes for AI hero sections
Prompt template: “On landing page, replace raw <img> hero with next/image, priority=true, sizes='(max-width:768px) 100vw, 1200px’, quality 80, placeholder blur if local asset. Preload only LCP image — not entire carousel.”
AI loves carousels on marketing pages — they murder LCP. Static hero beats animated slider for first paint unless you lazy-load slides after LCP fires. For CMS or Supabase-hosted images, add remotePatterns in next.config and use signed URLs with stable dimensions.
Server Components help LCP when data fetching blocks HTML — but waterfall serial awaits hurt. Parallelize fetches with Promise.all in page component. Cache fetch results with unstable_cache or tag revalidation for semi-static marketing content.
CLS fixes for AI layouts
Every image and video needs occupied space before load. AI-generated Tailwind often uses w-full without aspect ratio — add aspect-video or explicit h-* on containers. Skeleton loaders must match final content height; mismatched skeletons are a top CLS source in vibe-coded dashboards.
Font fixes: switch Google link tags to next/font. Subset to latin and weights you use (400, 600 — not 100–900). display: ‘swap’ is default in next/font — keep it.
Cookie consent and trial banners: position fixed with transform, or reserve padding-top on body equal to banner height. Do not insert banner above hero after paint without reserved space.
INP fixes for AI interactivity
INP replaced FID — it cares about all interactions, not just first. Heavy React state updates on every keystroke in AI-built filter UIs cause long tasks. Debounce search. Virtualize long lists. Move PDF parsing and CSV parsing off the click handler into Web Worker or server action.
Shadcn dialogs and dropdowns are fine — dozens of unmemoized context providers are not. Prompt: “Profile INP on /dashboard: identify click handlers >50ms, defer analytics, wrap setState bursts in startTransition.”
Third-party chat widgets are INP poison. Load Intercom/Crisp after requestIdleCallback or user scroll past fold. Measure before and after — founders often gain 100ms INP by delaying chat alone.
Next.js patterns that preserve wins
- Static generation for marketing; dynamic only where auth requires
- Route-level loading.tsx with same layout dimensions as page
- Image domains whitelisted once in config — no unoptimized escape hatches
- Bundle analyzer in CI when AI adds new dependencies weekly
- prefetch={false} on heavy dashboard links in nav if prefetch pulls MB of RSC payload
Core Web Vitals for AI-built sites improve incrementally. Ship one row from the fix table per PR, re-run Lighthouse, commit the score screenshot to internal docs — boring discipline beats “performance refactor” months later.
Monitoring CWV after launch
Add Vercel Speed Insights or a lightweight web-vitals beacon to your layout. Alert when LCP p75 crosses 3s for seven days — regression often follows a marketing prompt that added a full-width video background. Search Console links field CWV to URLs; fix worst URL first, not homepage only if dashboard is the CrUX loser.
Vercel Speed Insights and RUM
Install @vercel/speed-insights in root layout after fixes ship — real-user LCP/INP beats Lighthouse alone. Segment by route: marketing / vs app /dashboard often diverge. AI-built sites frequently optimize landing while dashboard loads 400kb of unused chart libraries on first paint.
Prompt: “Add Speed Insights to app/layout.tsx. Document in README how to read Vercel dashboard CWV tab. List top 5 routes by LCP from analytics if available.”
Font loading deep dive
Google Fonts link tags block render — replace with next/font. Subset to used characters for i18n later. Preload only primary weight. Variable fonts reduce file count but complicate FOUT debugging — pick one strategy per project.
AI exports often import six weights of Inter — delete 300, 500, 800 if unused. Check network tab: font requests should be one or two files, not half a dozen.
Dashboard routes vs marketing CWV
Authenticated dashboards can tolerate higher LCP if users are logged in with intent — still fix INP on primary actions (Save, Submit, Filter). Marketing pages need aggressive LCP — hero image priority, minimal JS. Split bundle: do not import recharts on landing page. Use dynamic import with loading skeleton matching chart height to prevent CLS.
Copy-paste agent menu for CWV sprint
- “Run Lighthouse mobile on /. List LCP element and top 3 opportunities.”
- “Fix LCP per core-web-vitals table row 1 — next/image hero with priority.”
- “Audit all images for width/height or aspect-ratio — fix CLS.”
- “Profile click on primary CTA — reduce INP with startTransition or defer analytics.”
- “Re-run Lighthouse; paste before/after scores in PR description.”
One PR per metric often merges faster than mega performance branch that conflicts with feature work.
LCP case study: AI landing page
Typical AI landing: full-width unsized hero, Google Fonts blocking, framer-motion on hero text, analytics in head. Fix sequence: (1) next/image priority on hero with sizes, (2) next/font swap, (3) defer motion until after LCP, (4) defer GTM. Often drops mobile LCP from 4.2s to 2.1s without redesign — measure your URL before claiming.
Server TTFB: if LCP element is HTML text but TTFB is 1.2s, fix data fetching before images. Cache marketing page at edge with revalidate 3600. Dynamic pricing badges hurt — static shell with client fetch for price if needed.
CLS case study: dashboard widgets
AI dashboards load skeleton then chart — skeleton height 120px, chart 280px, CLS 0.25. Fix: skeleton min-h-[280px] matching chart container. Avatar circles without width/height shift sidebar — fixed w-10 h-10. Toast notifications top-right without fixed container push content — use fixed positioning.
INP case study: search filter
Filter input onChange triggers full list filter + analytics + URL sync — 400ms INP. Fix: debounce 200ms, startTransition for list update, move analytics to requestIdleCallback. Virtualize list over 50 items with @tanstack/react-virtual. Prompt agent with flamegraph description if available.
Weekly measurement loop
- Monday: CrUX or Speed Insights p75 per key route
- Pick worst metric; one fix branch
- Thursday: merge and verify
- Friday: note regression triggers (new hero, new script)
Core Web Vitals for AI-built sites regress when marketing ships without perf review — add Lighthouse CI threshold optional on main for public routes.
Resource hints and preconnect
Preconnect only to origins you actually use — fonts, CDN, Stripe.js if embedded. Over-preconnect wastes connection slots. Preload LCP image href when using next/image with static import — Next handles most cases. AI adds duplicate preconnect tags in layout and _document — consolidate in one layout file.
Third-party embeds: Calendly, Typeform, YouTube iframe — defer below fold or facade click-to-load. Each iframe is LCP and INP risk on marketing pages. Prompt: “Lazy load YouTube embed with thumbnail facade; load iframe on click only.”
Caching strategy for vibe-coded Next.js
Static marketing: ISR revalidate 3600 or force-static where possible. Authenticated dashboard: dynamic but cache user-agnostic fragments. API routes: Cache-Control headers on public JSON — AI sets no-store everywhere killing CDN. Review each route — public pricing data can cache 60s at edge.
FAQ
Do AI app builders optimize CWV?
Most export functional code, not production performance. Export to Next.js and run this checklist before paid ads or AdSense review.
Is INP worse on React 19?
React 19 concurrent features help when used correctly; misuse of useEffect still hurts. Profile, do not assume framework version fixes INP.
Can I pass CWV with client-side only apps?
SPA-heavy apps struggle on LCP and INP. Prefer SSR/SSG for public pages even if app shell is client-heavy.
Does image CDN matter?
Yes — Vercel Image Optimization or Cloudinary transforms beat serving 3MB PNG from Supabase public URL in img tag.
Will fixing CWV help AdSense?
Indirectly — better UX, lower bounce, healthier traffic signals. Pair with AdSense approval guide for site-quality holistics.
Soft CTA: Run Lighthouse mobile on your production URL today. Pick the worst metric, copy one row from the fix table into your agent, merge, re-test. Core Web Vitals for AI-built sites are a maintenance habit — start with the hero image you never compressed.
