JavaScript rendering, SPA routing, and core HTML structure

The report compares the initial HTTP document with a browser-rendered DOM, then checks hydration changes, client redirects, console and page errors, metadata differences, and the core html, head, and body structure. This exposes content that depends on successful execution.

At a glance

Rendering should enhance a valid document, not rescue an empty or contradictory one

Deliver meaningful server HTML whenever practical, give every indexable view a stable URL and status, and keep critical metadata consistent before and after rendering. A browser can recover from malformed markup or client routing in ways that other consumers cannot.

  • Put essential content, links, status, and metadata in the initial response when possible.
  • Use real URLs and server handling for every indexable SPA route.
  • Never rely on client-side rendering to turn an error response into a valid page.
  • Compare server and rendered output for content, canonical, robots, title, and links.
01

How search rendering differs from a user session

Google crawls a URL, parses the response, and may queue a successful page for rendering. Rendering requires fetchable JavaScript and CSS and can happen later; other crawlers and AI tools may not execute JavaScript at all.

Server-side or static rendering therefore improves robustness and speed of discovery. Client rendering can still work, but critical content must remain visible in the rendered HTML and resources must not be blocked or depend on user interaction.

02

SPA routing and metadata failures

  • App shell only Initial HTML contains little unique content, so discovery and non-rendering consumers receive an incomplete page.
  • Client-only 404 The server returns 200 for an unknown route and JavaScript paints an error, creating a soft 404.
  • Metadata conflict Hydration changes canonical, robots, title, or description to a value that disagrees with server HTML.
  • Non-crawlable navigation Buttons or click handlers change views without exposing resolvable a[href] URLs.
03

Keep the document head deterministic

Return a well-formed html document with one head and body, put charset early, and keep metadata in the head. An oversized head or invalid body content inserted before metadata can cause parsers to close the head earlier than expected.

Render each public route directly on a fresh request, not only after client navigation. Capture JavaScript exceptions and failed resources, compare raw and rendered output, and test with JavaScript disabled to identify the essential fallback.

Action checklist

Make each route valid before hydration

  1. 01Open every representative route directly in a new anonymous session.
  2. 02Confirm server status, title, canonical, robots, links, and primary content.
  3. 03Compare raw HTML with the rendered DOM and resolve contradictions.
  4. 04Return real 404 responses for unknown SPA routes.
  5. 05Fix browser errors and blocked resources, then inspect with URL Inspection.

Official references

The technical recommendations in this guide are aligned with these primary sources.