client-side-rendering-fix/SKILL.md
Goal
Make every public page return its main text, title, meta description, canonical and links in the first HTML response, without JavaScript.
Facts to use
- A single-page app often sends
<div id="root"></div>and builds the page in the browser. - Google can render JavaScript, but rendering happens in a later step and can fail or be late. Many AI crawlers do not run JavaScript, so they get the empty shell.
- Google says dynamic rendering (a separate HTML version only for bots) was a workaround, not a long-term solution. Google recommends server-side rendering, static rendering or hydration that serves the same HTML to users and bots.
Options, best first
- Server-side rendering or static site generation in the framework (for example Next.js, Nuxt, Astro, TanStack Start, Remix). Best when the owner can change the framework.
- Build-time prerender of public routes into static HTML files (for example a prerender plugin for Vite). Good for marketing pages that do not change per user.
- Static HTML twins: one plain HTML file per public page with the same text, title, meta and links, served at the same URL by the host or CDN (see static-html-twins).
- Edge rewrite: a worker or edge function that returns prerendered HTML for public routes.
Workflow
- Run the crawler-access-test skill on the main routes. Record raw word count and rendered word count.
- Identify the platform and host. Lovable, Base44, Bolt and Replit apps often deploy as static SPAs. Check if the platform has a built-in prerender or SSR option first.
- Pick the highest option the owner can use. Explain the choice in one sentence.
- Make each public route return in raw HTML: a unique
<title>, meta description,<link rel="canonical">, one<h1>, the main body text and<a href>links to other pages. - Keep app pages that need a login out of scope. Mark them
noindexif they are reachable. - Make unknown routes return status 404 (see soft-404-fix).
Checks
- Raw HTML word count is close to rendered word count for each public route.
- Raw title and canonical match the rendered ones.
- Google URL Inspection "View crawled page" shows the text.
Output
The chosen option, the files changed, and a before and after table of raw word counts per route.
Sources
- Google: Understand JavaScript SEO basics. https://developers.google.com/search/docs/crawling-indexing/javascript/javascript-seo-basics
- Google: Dynamic rendering as a workaround. https://developers.google.com/search/docs/crawling-indexing/javascript/dynamic-rendering
- Google: Fix Search-related JavaScript problems. https://developers.google.com/search/docs/guides/fix-search-javascript