Fix INP Over 300ms in Google Search Console

Optimize mobile button click latency and eliminate Page Experience Core Web Vitals penalties.

  • Home
  • Fix INP Over 300ms in Google Search Console
Core Web Vitals Engineering Handbook

Why Google Shows INP Over 300ms (And How to Fix It)

Your synthetic Lighthouse tests show a green 50ms, yet Google Search Console flags your URLs with "INP issue: longer than 200ms (mobile)". This discrepancy happens because field data (CrUX) captures real users interacting on slow mobile CPUs.

4 Primary Causes of High Mobile INP

1. Main Thread Congestion from Heavy Click Handlers

Running synchronous state updates, JSON parsing, or analytics tracking directly inside an onClick handler blocks the browser from drawing the next frame.

The Fix: Wrap non-urgent calculations in setTimeout, requestIdleCallback, or React's startTransition API.

2. Third-Party Script Listeners & Tag Managers

GTM, heatmaps, and chat widgets often attach passive event listeners across the document that delay visual feedback by 100–300ms on budget mobile CPUs.

The Fix: Audit third-party scripts, defer non-critical widgets, and verify that touchstart / pointerdown listeners are marked passive.

3. React / Next.js Hydration Mismatch Latency

If a user taps an interactive button before client hydration completes, the browser queues the event, producing massive INP spikes in real user monitoring (RUM).

The Fix: Leverage React Server Components, reduce bundle size, and use streaming SSR with Suspense boundaries.

4. DOM Size Explosion & Costly Recalculate Style

Mutating styles on complex DOM trees (> 1,500 elements) triggers expensive style recalcs and layout operations before the browser can paint.

The Fix: Keep DOM shallow, utilize CSS content-visibility: auto for offscreen nodes, and avoid inline layout-triggering properties.

Code Pattern: Yielding to the Main Thread

Interaction to Next Paint measures the time between user input and visual frame presentation. Provide visual feedback immediately.

Bad: Synchronous Click Handler Blocking Main Thread
// ❌ Causes INP > 300ms on mobile devices
function handleAddToCart(productId) {
  // Synchronous heavy work blocks visual feedback
  const computed = heavyCartCalculation(productId); 
  sendAnalyticsBeaconSync(productId); 
  setCartState(computed); // React re-renders entire tree before paint
}
Good: Yield to the Main Thread via scheduler.yield() or setTimeout
// ✅ Instant visual feedback: INP < 50ms
function handleAddToCart(productId) {
  // 1. Immediately provide visual UI feedback (spinner/active state)
  setButtonState('loading');

  // 2. Yield to browser main thread so the frame can paint
  setTimeout(() => {
    const computed = heavyCartCalculation(productId);
    setCartState(computed);
    sendAnalyticsBeacon(productId);
  }, 0);
}

How to Capture Every INP with PerformanceObserver

Standard event timing observers miss interactions when durationThreshold is left too high. Configure your browser observer with durationThreshold: 40 to capture both low and high latency mobile clicks:

new PerformanceObserver((entryList) => {
  for (const entry of entryList.getEntries()) {
    if (!entry.interactionId) continue;
    console.log(`Interaction ID: ${entry.interactionId}, Duration: ${entry.duration}ms, Target: ${entry.target?.tagName}`);
  }
}).observe({ type: 'event', buffered: true, durationThreshold: 40 });

Stop Guessing INP and LCP Bottlenecks

Test your mobile rendering path, hydration delays, and Google Search Console performance using WebKernelAI.