senternet-site-prerender

Prerenders React SPA routes to static HTML snapshots using Puppeteer for SEO crawlers.

Updated May 8, 2026
One-click install
npx skills add https://github.com/MattSenter/senternet-site-skills --skill senternet-site-prerender-mattsenter
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: senternet-site-prerender
Source: https://github.com/MattSenter/senternet-site-skills/tree/main/.claude/skills/senternet-site-prerender
Command: npx skills add https://github.com/MattSenter/senternet-site-skills --skill senternet-site-prerender-mattsenter

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires puppeteer.

What problem does it solve? React single-page applications serve a near-empty index.html to search engine crawlers and social media link previews, so Googlebot, Twitter, Discord, and Slack see no page content or meta tags. This Skill adds Puppeteer-based static prerendering so every route produces a real HTML snapshot with full content and correct meta tags. ## Core Features & Use Cases - Headless Route Prerendering: Visits each route in a local static server with Puppeteer, waits for React to mount via an app-ready event, and writes the rendered HTML to disk per route. - Hydration Setup: Converts src/main.tsx to hydrateRoot so React attaches to prerendered DOM, preserving LCP from the initial HTML paint. - Third-Party Script Stripping: Removes GA, Clarity, and Reddit pixel scripts from snapshots so they do not double-load for real visitors, with support for multilingual locale routes. - Use Case: After adding a /pricing page to a Vite React marketing site, add the route to the ROUTES array, run the build:prod script, and verify the prerendered build/pricing/index.html contains the page headline and meta tags. ## Quick Start Ask the AI to add Puppeteer prerendering to my Vite React site so every route outputs a static HTML snapshot for SEO.

Frequently Asked Questions about senternet-site-prerender

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prerender a React SPA for SEO with Puppeteer?▼

Install puppeteer, switch src/main.tsx to hydrateRoot, and create scripts/prerender.mjs that serves the build folder, visits each route in headless Chrome, waits for the app-ready event, and writes the rendered HTML to disk per route.

Why does my React site show empty content to Googlebot?▼

React SPAs serve a near-empty index.html by default, so crawlers that run no JavaScript see no content or meta tags. Prerendering each route with a headless browser writes the fully rendered HTML to disk for crawlers.

Does this prerendering approach work with Next.js?▼

No, this skill explicitly does not apply to Next.js. Next.js already renders routes to static HTML during next build, so running Puppeteer over that output would create a divergent duplicate of every page.

Why does a prerendered route come out empty?▼

An empty route means the app-ready event never fired or React did not mount in time. Check that the page component dispatches document.dispatchEvent(new Event('app-ready')) in a useEffect and that MetaTags is rendered.

How do I prerender multilingual routes like /es/ or /fr/?▼

Loop over a LOCALES array alongside ROUTES, set window.__LANG__ via evaluateOnNewDocument for non-default languages, and write output to locale subdirectories such as build/es/<route>/index.html.