Snoika
Technical SEO·Supporting article

JavaScript SEO guide: how Google renders modern sites, what breaks

JavaScript SEO is the work of making sure crawlers can read content that a browser builds with JavaScript. Google does render JavaScript. It runs your scripts in a headless Chromium browser and indexes the result within seconds. Problems start outside that path. Content can sit in a render queue for hours, or appear only after a click. And most AI crawlers read the raw HTML only, so they never see anything your scripts add later.

Portrait of Anton VedeshinAnton VedeshinFounder, Snoika · 6 min read
Four people in their fifties and sixties on an office rooftop terrace with a city skyline.

How Google crawls JS sites

Google crawls a JavaScript site twice, first as raw HTML and then as a rendered page. Googlebot fetches the URL and reads the HTML the server sends to extract the links it finds there. Every page that returns a 200 status then goes into a render queue. Google's own documentation says the page "may stay on this queue for a few seconds", but adds that it can take longer. Once Google has capacity, headless Chromium runs the JavaScript. Googlebot reads the rendered HTML for new links and indexes that version.

So yes, Google renders JavaScript for indexing. The catch is that rendering depends on everything the page needs being reachable. Google won't render scripts that robots.txt blocks. Googlebot also fetches only the first 2MB of each file, and it fetches every CSS and JavaScript file separately under the same cap. Check that your robots.txt allows your script folders and API endpoints, and that no single bundle goes over that limit.

Rendering delays hurt indexing

Rendering delays are short, but the long ones land on the pages you can least afford to lose. Vercel and MERJ, a technical SEO consultancy, tracked Googlebot on nextjs.org. They found a median render delay of 10 seconds, but the slowest pages waited hours. Martin Splitt, a Developer Advocate at Google, gave a more optimistic figure in an interview: "The 99th percentile is within minutes."

The wait matters less than what Google decides before rendering starts. Google's documentation warns that when it sees a `noindex` tag, it "may skip rendering and JavaScript execution". A page that ships `noindex` and removes it with a script depends on Google executing that script to get indexed. Vercel's study also found that Google judges a link's value only after the full render. If your prices or stock levels change hourly, a page stuck in the slow tail of the queue gets indexed with stale content.

AI crawlers skip JavaScript

Most AI crawlers can't read JavaScript-rendered content. They fetch your HTML and stop there. In a December 2024 log study, Vercel found that none of the major AI crawlers execute JavaScript. That list covers OpenAI's GPTBot and ChatGPT-User, Anthropic's ClaudeBot and PerplexityBot. The same crawlers do download script files (11.50% of ChatGPT's requests and 23.84% of Claude's), but they never run them.

Two exceptions matter. Google's Gemini uses Googlebot's rendering setup, and AppleBot renders pages with a browser-based crawler. Everything else sees whatever your server sends first. If your product descriptions or article text arrive through client-side fetch calls, ChatGPT and Claude get an empty shell and have nothing from your page to quote. Test this by requesting your page with JavaScript turned off and reading what comes back.

Client-side rendering risks

Client-side rendering (CSR) makes every crawler depend on successful script execution. The server sends a near-empty HTML file, and the browser builds the page. Google's Martin Splitt put the trade-off plainly in his interview with Search Engine Journal: "If you have a website that is a classical website that is basically just presenting information to the user, then requiring JavaScript is a drawback. It can break."

The failures follow from how CSR works. An API call that times out during Google's render leaves the page blank. Content that loads only on a click or on scroll is invisible to Googlebot, because it doesn't click or scroll. A missing product that returns a 200 status with an error message turns into a soft 404. Signals also drift, as the 2024 Web Almanac found that one in 50 mobile pages had its canonical tag changed during rendering. When the raw and rendered versions disagree, you've handed the decision to Google.

Which framework suits SEO

No JavaScript framework is best for SEO on its own. SEO depends on the rendering mode you ship. React, Vue and Angular default to client-side rendering when you build a plain single-page app. Their meta-frameworks change that. Next.js for React, Nuxt for Vue and Angular's own server rendering all return full HTML on the first request. Astro and SvelteKit do the same by default.

Pick by how your content changes. Static generation suits a blog or documentation site, while server rendering suits a store with live prices. A logged-in dashboard can stay client-side, because no crawler needs to see it. The table compares the modes against the two kinds of crawler you care about.

Client-side rendering (CSR)

Content in first HTML response
No
Googlebot
Sees it after render (median delay 10 seconds on nextjs.org)
GPTBot, ClaudeBot, PerplexityBot
Sees an empty shell
Google's position
Works, with risk

Server-side rendering (SSR)

Content in first HTML response
Yes
Googlebot
Sees it on crawl
GPTBot, ClaudeBot, PerplexityBot
Sees it
Google's position
Recommended

Static site generation (SSG)

Content in first HTML response
Yes
Googlebot
Sees it on crawl
GPTBot, ClaudeBot, PerplexityBot
Sees it
Google's position
Recommended

Hybrid (SSR plus hydration)

Content in first HTML response
Yes
Googlebot
Sees it on crawl
GPTBot, ClaudeBot, PerplexityBot
Sees it
Google's position
Recommended

Dynamic rendering

Content in first HTML response
Yes, for bots only
Googlebot
Sees it on crawl
GPTBot, ClaudeBot, PerplexityBot
Sees it if the bot is detected
Google's position
"A workaround"

Server-side rendering explained

Server-side rendering (SSR) runs your JavaScript on the server and sends the browser finished HTML. The first response contains the headings and body text. It also contains links and meta tags, so any crawler can read the page without a render step. The browser then loads the same JavaScript and attaches event handlers to that markup. This step is called hydration.

The cost moves from the visitor's device to your server. Every request now triggers a render, which can slow Time to First Byte (TTFB) under load unless you cache the output. Static site generation (SSG) avoids that cost because pages are built once at deploy time. That works well until your content changes faster than you can redeploy. Check SSR pages for hydration errors in the browser console. When the server markup and the client markup disagree, frameworks re-render the page and undo the benefit.

Hybrid rendering as a fix

Hybrid rendering fixes most JavaScript SEO problems an SEO audit finds, without a rebuild, because you choose the rendering mode route by route. Marketing pages can be static, which also helps mobile SEO, while product pages use server rendering. The account area can stay client-side. Next.js calls one version of this incremental static regeneration. It serves a static page and rebuilds it in the background on a timer.

Google has steered sites this way since 2022. That year it updated its documentation to call dynamic rendering "a workaround and not a long-term solution" and recommended server-side or static rendering. It also recommended hydration. Sites have followed. According to the 2024 Web Almanac, the `vary` header that dynamic rendering relies on fell to 1% of desktop pages. If you still run a prerender service for bots, move your highest-traffic templates to hybrid rendering first.

Diagnosing your JS SEO gaps

You find JavaScript SEO gaps by comparing what your server sends with what a browser builds, then checking which version each crawler indexed. Run the checks below on your main templates, since a rendering fault breaks every page that shares the template.

Compare the raw HTML with the rendered DOM

Open view-source on a page and search for a sentence from the main content. Then do the same in the browser's element inspector. If the sentence appears only in the inspector, JavaScript adds it, and non-rendering crawlers miss it. Check the title and canonical the same way. Repeat the check for the robots meta tag and internal links.

Check what Google rendered

The URL Inspection tool in Google Search Console shows the HTML Google rendered for an indexed page. Compare it with the live page. Missing sections point to a blocked resource or an API call that failed during rendering.

Read the page as an AI crawler would

Fetch the page with curl or a browser that has JavaScript turned off, and send GPTBot's user agent string. What you get back is roughly what ChatGPT can use. Then check your server logs to confirm AI crawlers aren't blocked at the firewall.

Fixes that protect organic visibility

The fixes that protect visibility all put critical content and signals in the first HTML response. Work through them in order of traffic with the templates that earn the most visits first.

  • Server-render or pre-render the main content with its headings. Do the same for structured data.
  • Use real `<a href>` links for navigation.
  • Set `noindex` and canonical tags in the initial HTML and never change them with JavaScript.
  • Return a 404 status for missing pages.
  • Give each view its own URL through the History API.
  • Allow your JavaScript, CSS and API paths in robots.txt.
  • Keep critical content early in the HTML and every file under Google's 2MB fetch limit.

Recheck the raw HTML after every major deploy. Framework upgrades and new components can quietly move content back to the client.

What to do next

Start with your top five templates by organic traffic and run the raw-versus-rendered comparison on each. Whatever is missing from the raw HTML is your JavaScript SEO backlog, and it costs you twice. Google sees that content late, and ChatGPT and Claude don't see it at all. Fix those templates before you touch anything else, since one template fix covers every page built on it. Snoika audits websites and tracks brand visibility in both Google and AI assistants, with human review on top of the platform. To see how your rendering setup affects both, talk to an AI search expert.

FAQ

See how AI talks about your brand

Get free audit