Skip to content

Make a React app readable to ChatGPT and Google

A Vite or Create React App build sends a div and a script. ChatGPT, Claude and Perplexity keep that div. Google can render later. The HTML you want indexed has to exist before the script runs.

Check what AI crawlers see on one of your URLs. The result is the HTML before JavaScript runs, plus any robots.txt block for GPTBot, ClaudeBot, PerplexityBot and Googlebot.

What the crawler actually receives

Open the page, then view the source, not the Elements panel. The Elements panel is the page after JavaScript. Source is the response. On a client-rendered React app that response is a document, a root div, and a script pointing at your bundle. The product names, the prices and the article are not in it yet.

Vercel and MERJ measured GPTBot, OAI-SearchBot, ChatGPT-User, ClaudeBot and PerplexityBot fetching pages without executing JavaScript. They did download script files. A request for main.js in the logs is not the bot building your tree. Googlebot is the exception in that study, because Gemini and Google Search render JavaScript in a later wave. The first response is still the one you should be able to read.

The response GPTBot keeps

<html>
  <body>
    <div id="root"></div>
    <script type="module" src="/assets/index.js"></script>
  </body>
</html>

No words in the body

The page after JavaScript runs

<div id="root">
  <nav><a href="/products">Products</a></nav>
  <main>
    <h1>The page title</h1>
    <p>The words you want cited.</p>
  </main>
</div>

Only a crawler that runs JavaScript gets this

A simplified example. View source on your own URL to see the real response.

Vite and Create React App

Vite's React template and Create React App both ship a client bundle. There is no server step that walks the component tree unless you add one. React Router in the browser does not create a URL a crawler can request unless you also render real anchors. A button with an onClick and no href is invisible as a link.

The crawler check counts words in that first HTML and flags an app shell when the count is under 60 and the document has a root, app, or react marker. Run it on a product URL, not only the homepage. Homepages are often the one route someone filled in by hand.

How the word count turns into a verdict

Nearly invisible
Under 60 words
Partially visible
60 to 250 words
Readable
250 words or more, with a meta description

Three fixes

Static generation walks the routes at build time and writes an HTML file per URL. It fits pages that are the same for every visitor: docs, marketing, a catalog that can be rebuilt on publish. It does not fit a page whose content depends on the person looking at it, unless you render a useful public version and load the private bits after.

Server rendering runs the tree on the request. Next.js, Remix and other React frameworks do this. Moving a Vite app there is a rewrite, not a setting. It is the right project when you are already replacing the router and the data loading. Google's dynamic rendering note says server-side rendering, static rendering or hydration is the long-term fix.

Prerendering leaves the Vite app alone and renders it for crawler user agents. The visitor still downloads the bundle. GPTBot, ClaudeBot and PerplexityBot get the HTML after the app has drawn. Pagerender does that without a rebuild of the app. Try it free for a week on the URL the checker called empty, and compare the word count before and after.

What not to confuse with a fix

A sitemap does not put text into an empty div. A meta description does not replace the body. JSON-LD that describes a product the HTML does not contain is a hint, and a crawler that only reads the document still needs the words. Rendertron is the old headless Chrome server for this job, and the repository is archived.

If the checker shows a 401, 403, 429 or 503 for GPTBot, the template is not the first bug. The host challenged the bot. Fix the firewall, then look at the HTML. Both can be wrong at once. The checker shows them on separate rows so you can tell.

Common questions

Does React 19 change what crawlers see?

Not by itself. A client bundle is still a client bundle. Server rendering is a framework choice on top of React, not a new React default.

Will Google index a Vite app anyway?

Googlebot can render JavaScript later. The AI crawlers in the Vercel study do not. If the words are only in the bundle, those crawlers have nothing to cite, even when Google eventually does.

We use optional analytics cookies to see how visitors find Pagerender and which parts of the product they use. Privacy policy