The rendering problem
If your content only appears after JavaScript runs, search engines must render the page to see it — an expensive, sometimes-delayed second pass. Get it wrong and engines index a blank shell, or your content shows up days late (or not at all). AI crawlers are even less likely to execute JS.
Rendering strategies
- SSR (server-side rendering) or SSG (static generation) — the HTML arrives with content already in it. Best for SEO. (Frameworks like Next.js do this.)
- Client-side rendering only — riskiest for SEO; the page is empty until JS runs.
- Dynamic rendering — a legacy stopgap; prefer SSR/SSG.
Practical rules
- Make sure critical content and links are in the initial HTML (view source, not just the rendered DOM).
- Don't hide primary content behind clicks/tabs that require JS to load it.
- Use real anchor-tag links (with an href), not JS-only click handlers, so crawlers can follow them.
- Test with Search Console's URL Inspection ("View crawled page") to see what Google actually got.
The takeaway
JavaScript is fine — but the content and links that matter for SEO should reach the crawler in the HTML. When in doubt, render on the server.