Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Page blank until JavaScript loads: how to fix client-side rendering

PRF-016High impactPartlyBy FunnelGuardPublished Updated
On this page

What this issue is

With client-side rendering, the server returns a tiny HTML page, often just <div id="root"></div> and a script tag. The browser must download the JavaScript, run it, and only then draw the headline, image and buttons. Until that finishes, the screen is blank or shows a spinner.

What a client-side rendered page often sendshtml
<!doctype html>
<html>
  <head>
    <title>Book a demo</title>
    <script defer src="/static/app.8f3a1c.js"></script>
  </head>
  <body>
    <div id="root"></div>
  </body>
</html>

Why it costs you leads or sales

Largest Contentful Paint (LCP) measures when the biggest visible element appears. On a CSR page, that element cannot appear until the whole bundle has run, so LCP is late by design. Phones on mobile data and older devices feel this most, and paid traffic is often mostly mobile.

Where a CSR landing page loses visitors
  1. Ad clickVisitor lands on your URL
  2. Empty HTMLOnly a root div arrives
  3. JS bundle runsSlow download or parse leaves a blank screen
  4. Content and formAppear late, or never
  5. Lead or saleVisitor has already left

The visitor sees nothing until the bundle runs, so every later step is delayed or lost.

Time until the headline is visibleExample numbers
Time until the headline is visible (example)Client-side rendered: 5.2 seconds; Server-rendered HTML: 2.1 seconds0245.22.1Client-side renderedServer-rendered HTMLseconds

Example: illustrative numbers on a mid-range phone with a slow connection. Your timings will differ.

How to check if your site has it

Check whether the first screen is in the HTML
  1. View the raw source

    Open the page, right-click and choose View page source (not Inspect). If you see your headline and button text, the content is in the HTML. If you only see an empty root div and script tags, the page is client-side rendered.

  2. Fetch it without JavaScript

    Run curl on the URL and search for your headline. If it is missing, the server is not sending it.

  3. Disable JavaScript in Chrome DevTools

    Open DevTools, press Ctrl+Shift+P (Cmd+Shift+P on Mac), type 'Disable JavaScript' and reload. A blank page confirms the problem.

  4. Throttle the network

    In the Network tab choose Slow 4G and a 4x CPU slowdown in the Performance tab, then reload. Watch how long the screen stays blank.

  5. Run Lighthouse or PageSpeed Insights

    Look at the LCP value and the 'Reduce JavaScript execution time' and 'Avoid enormous bundles' hints. A late LCP with a small image points to rendering delay.

Does the headline exist in the raw HTML?bash
curl -s https://example.com/landing | grep -i "your headline text" || echo "Not in HTML: content is rendered by JavaScript"
What the visitor sees

A blank screen while the bundle loads, then content, if the script succeeds.

How to fix it

The goal is that the headline, hero image, copy and call-to-action button are present in the first HTML response. The exact route depends on your stack.

Fix by platform
  1. Pick a rendering mode

    For a React app, move to a framework that renders on the server or at build time, such as Next.js (static generation or server components), Remix or Astro. For Vue use Nuxt, and for Angular use Angular SSR. Static generation is the best fit for landing pages that rarely change.

  2. Or prerender the key routes

    If a rewrite is too big, prerender your landing and funnel routes to static HTML at build time and serve those files, so the app only takes over after the first paint.

  3. Split and defer the bundle

    Use code splitting and dynamic imports so the landing route does not load the whole app. Defer chat widgets, analytics extras and below-the-fold components.

  4. Put the LCP image in the HTML

    Make sure the hero image is a real img tag in the server HTML, not created by JavaScript.

Before and after

Client-side rendered

  • HTML contains only an empty root div
  • Headline and form appear after the bundle runs
  • Blank screen on slow phones
  • If the script fails, nothing shows

Server or static rendered

  • Headline, image and button are in the HTML
  • Content paints as soon as the HTML and CSS arrive
  • JavaScript adds interactivity afterwards
  • Page still shows content if a script is slow

How to confirm it's fixed

Confirm the first screen no longer depends on JavaScript
  • View page source shows your headline, hero image tag and button text
  • The page shows its main content with JavaScript disabled
  • The curl check finds your headline
  • LCP in Lighthouse or PageSpeed Insights has dropped on mobile
  • The form or button still works once JavaScript has loaded
  • Ad and analytics tags still fire after the change

How to prevent it happening again

Keep landing pages server-rendered
  • Set a rule that landing and funnel routes must render HTML on the server or at build time
  • Add a build check that the headline text appears in the generated HTML
  • Set a JavaScript budget for landing routes and review it when dependencies change
  • Test on a throttled mobile profile before each release
  • Re-test after adding new embeds, widgets or tag changes

How FunnelGuard handles this

FunnelGuard detects this issue only partly. A robot visitor loads your funnel pages on a schedule and checks LCP and blank-page timeouts. If a step is slow to show its largest element, or the page stays blank until a timeout, the failure is re-checked from a second region and you get one alert with a screenshot and a likely cause.

Questions people ask

Why is my page blank until JavaScript loads?

Your page is probably client-side rendered. The server sends an almost empty HTML file and the browser builds the content after it downloads and runs the JavaScript bundle. Until that finishes, there is nothing to show.

How do I check if my page is client-side rendered?

Right-click and choose View page source. If your headline and button text are missing and you only see an empty root div and script tags, the page is client-side rendered. You can also disable JavaScript in Chrome DevTools and reload to see if the page goes blank.

Does client-side rendering hurt LCP?

Yes. The largest element cannot be painted until the JavaScript has run and built it, so LCP is pushed later. The effect is worst on slow phones and connections.

How do I fix a React app that shows a white screen before it loads?

Render the first screen on the server or at build time with a framework such as Next.js, Remix or Astro, or prerender your landing routes to static HTML. Then reduce the remaining bundle with code splitting so the page becomes interactive sooner.

Is a loading spinner enough to fix a blank page?

No. A spinner is also drawn by JavaScript, so it still waits for the bundle and does not improve LCP. The real headline, image and button need to be in the HTML.

Is server-side rendering always better than client-side rendering for landing pages?

For landing pages and funnel entry steps, usually yes, because visitors see content sooner and the page works even if a script is slow. Highly interactive app screens behind a login can stay client-side rendered.

Can FunnelGuard tell me my page is client-side rendered?

Not directly. FunnelGuard checks LCP and blank-page timeouts on your funnel steps, so it can alert you when a page is slow or stays blank. It does not inspect your HTML to identify the rendering method, so confirm that with View page source.

Does FunnelGuard catch this?

Partly

FunnelGuard checks part of this.

How: LCP + blank-page timeouts.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.