JavaScript Rendering and AI Crawlers: What Breaks and How to Fix It
Most AI crawlers do not execute JavaScript. They fetch the HTML your server returns and move on. If your main content is assembled in the browser after load, those crawlers receive an empty shell, and a page they cannot read is a page they cannot cite.
This is one of the most common and most invisible causes of AI invisibility, because the site looks perfect to every human who checks it.
Why this happens
Googlebot runs a rendering step: it fetches, queues the page, executes JavaScript, and indexes the result. That has trained a generation of developers to assume all crawlers do the same.
They do not. Retrieval crawlers are built for speed and scale across a very large candidate set, and rendering is expensive. Many simply take the initial HTML response. Some render inconsistently. Few publish exactly what they do, which means the safe assumption is that they do not render at all.
The consequence: your site can rank perfectly well in Google, where rendering happens, and be functionally blank to the crawler feeding ChatGPT search.
What breaks, specifically
- Main body copy injected by a framework after load.
- Internal links implemented as click handlers rather than
<a href>elements, which breaks discovery as well as content. - Structured data injected by a tag manager or after hydration. Your entire entity graph can be invisible.
- Content behind interactions, such as tabs or accordions that fetch on click rather than rendering hidden in the DOM.
- Infinite scroll content with no server-rendered or paginated equivalent.
- Text inside client-side charting or map libraries, which often never becomes real text at all.
How to check what crawlers see
Three tests, in increasing order of realism.
1. View source, not Inspect. The browser inspector shows the rendered DOM after JavaScript has run. View Source shows what the server actually sent. If your article text is missing from View Source, you have the problem.
2. Fetch the raw HTML.
curl -s https://example.com/your-page/ | head -100
If the main content is not in that output, a non-rendering crawler does not have it either. Pipe it through grep to check for a specific sentence you expect to find.
3. Disable JavaScript and reload. Whatever remains is roughly what a non-rendering crawler receives. This catches interaction-dependent content that the first two tests can miss.
For Googlebot specifically, Search Console’s URL Inspection tool shows the rendered HTML Google produced, which is useful for comparison but tells you nothing about AI crawlers.
The fix: send real HTML
Server-side rendering or static generation. The page’s HTML is produced on the server or at build time, so the initial response is complete. Astro, Next.js, Nuxt and SvelteKit all support this, and for a content site static generation is usually both the simplest and the fastest option. This site is statically generated for exactly this reason.
Prerendering is the pragmatic middle path for an existing client-only application: serve prebuilt HTML for the routes that matter for visibility, and keep the app’s interactivity elsewhere.
Keep hydration additive. The pattern that works is: complete HTML first, JavaScript enhances it. The pattern that fails is: empty shell first, JavaScript creates it.
Put structured data in the initial response. If your JSON-LD is injected by a tag manager, move it into the server-rendered HTML. Validate the live URL rather than the template, as covered in structured data for AI search.
Use real links. <a href="https://example.com/page/"> for anything you want discovered. Click handlers are not links.
A quick audit checklist
- Main content appears in View Source on your top ten pages.
-
curlreturns the body copy, not just a shell. - Internal links are
<a href>elements. - JSON-LD is present in the raw HTML.
- Nothing essential requires an interaction to load.
- Lazy loading applies only to below-the-fold media.
- The page is still usable with JavaScript disabled.
Rendering and speed reinforce each other
Server-rendered HTML usually arrives faster and with less layout shift than a client-assembled page, which helps Core Web Vitals as well as crawler access. The two problems have the same fix, which is unusual and worth exploiting: one architectural decision improves human experience, search ranking, and AI retrieval simultaneously.
Where rendering fits in the bigger picture
Rendering sits alongside crawler access as the pair of technical gates on AI visibility. You can be perfectly permitted and still invisible, or perfectly rendered and still blocked. Check both: the access side is in robots.txt for AI crawlers, including the CDN layer that overrides it, and the full technical list is the technical SEO checklist for AI search.
Rendering problems also tend to arrive with a rebuild. If you are moving to a new framework, the website migration SEO checklist includes a pre-launch rendering check.
The next constraint: agents
The same discipline decides whether AI agents can operate your site, not merely read it. An agent that cannot parse your pricing or complete your form abandons silently, leaving no trace in analytics. See agentic search optimization.
The bottom line on JavaScript rendering
If your content is not in the HTML your server sends, assume AI crawlers do not have it. Test with View Source and curl rather than the inspector, fix with server-side rendering or prerendering, and re-check after every release, because this is a regression that ships silently.
Want to know exactly what AI crawlers receive when they hit your pages, and where JavaScript is hiding your content? Request an AI visibility audit and we will show you the raw HTML picture, page by page.
Frequently asked questions
Do AI crawlers execute JavaScript?
Most do not, or do so inconsistently. Unlike Googlebot, which runs a rendering step, many AI crawlers fetch raw HTML and move on. If your content only appears after JavaScript runs, those crawlers may never see it.
How do I know if my content needs JavaScript to appear?
Fetch the page's raw HTML with curl, or use View Source rather than Inspect in your browser. If the main text and links are missing from that raw HTML and only appear in the rendered DOM, your content depends on JavaScript.
Does server-side rendering fix the problem?
Largely, yes. Server-side rendering or static generation sends complete HTML in the initial response, so a crawler that does not run JavaScript still receives your content. Astro, Next.js, Nuxt and SvelteKit all support this.
Is a single-page app bad for AI search?
A client-only SPA is risky, because its content is assembled by JavaScript after load. You can keep the interactivity while adding server-side rendering or prerendering so crawlers receive real HTML.
Does this affect structured data too?
Yes, and it is a common oversight. JSON-LD injected by a tag manager or after hydration may never be seen by crawlers that do not execute scripts. Structured data should be in the initial HTML response.
If Googlebot renders JavaScript, why does this matter?
Because Googlebot is not the only crawler that matters now. Ranking in Google is only one half of AI visibility, and the retrieval crawlers behind ChatGPT and Perplexity are far less forgiving than Googlebot about client-side rendering.