webdev-ssr-conversion

Convert React 19 + Vite + Express + tRPC SPAs into server-side rendered apps with per-route SEO meta tags.

Updated Aug 28, 2026
One-click install
npx skills add https://github.com/AnderHonorato/Mem-rias-IA---Infinity --skill webdev-ssr-conversion-anderhonorato
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: webdev-ssr-conversion
Source: https://github.com/AnderHonorato/Mem-rias-IA---Infinity/tree/main/Manus/Skills/webdev-ssr-conversion
Command: npx skills add https://github.com/AnderHonorato/Mem-rias-IA---Infinity --skill webdev-ssr-conversion-anderhonorato

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Client-only single-page apps built on the Manus web-db-user template render an empty shell to crawlers and social scrapers that do not execute JavaScript, breaking SEO indexing and link-preview cards. This Skill converts such an app to server-side rendering so first-paint HTML contains real content, per-route titles, and Open Graph tags. ## Core Features & Use Cases - Full SSR conversion checklist: Splits the app into entry-server/entry-client, prefetches tRPC queries in-process via a server-side caller, dehydrates TanStack Query state into the HTML, and hydrates on the client without changing any page component or design. - SEO parity built in: Injects per-route title, description, og:/twitter: tags, canonical URLs, real 404 status codes, and noindex handling for auth-gated routes directly into the server response. - Pitfall-driven debugging references: Documents concrete failures (window-is-not-defined, jsxDEV build leaks, hydration mismatches, lazy-route spinners, stored XSS via head tags) with root causes and fixes, plus a copyable verify-ssr.sh crawler harness. - Use Case: A marketing site built on the Manus full-stack template gets no Google indexing and blank social share cards; apply this Skill to server-render every public route, then verify with the bundled curl-based script that crawlers receive populated HTML and correct status codes. ## Quick Start Ask the AI to convert this Manus web-db-user template project to server-side rendering so crawlers and link previews see fully rendered pages.

Frequently Asked Questions about webdev-ssr-conversion

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

FAQPage Schema
How do I convert a React SPA to server-side rendering for SEO?

Split the app into entry-server.tsx (renderToString with prefetched data) and entry-client.tsx (hydrateRoot), prefetch each route's queries into a QueryClient, dehydrate the state into the HTML, and let the server inject per-route title and meta tags. This Skill provides the full checklist and copy-adaptable source for the Manus tRPC template.

How do I make tRPC data available during server-side rendering?

Build an in-process caller with appRouter.createCaller(ctx) so SSR prefetch runs procedures as plain function calls, preserving ctx.user from the cookie without HTTP loopback. Seed results into the query cache under the exact getQueryKey the component's useQuery produces.

Does this SSR approach work with Next.js, Remix, or Astro apps?

No. The conversion targets only the Manus web-db-user template stack: React 19, Vite 7, Express 4, tRPC 11, wouter, TanStack Query 5, and superjson. Frameworks like Next.js or Remix already render on the server and need no conversion.

Why does SSR fail with 'window is not defined' errors?

Browser globals like window, document, and localStorage are undefined in Node, so any access on the render path crashes renderToString and silently falls back to the empty shell. Guard app code with typeof window checks, and keep dependencies that touch window at module scope out of the server import graph.

Why do crawlers still see an empty page after enabling SSR?

Common causes are express.static serving index.html before the SSR handler, a render exception falling back to the SPA shell, or a React.lazy route emitting only its Suspense fallback. The bundled verify-ssr.sh script asserts body content inside #root and correct status codes to catch these.

What are the limitations of this SSR conversion?

It covers only SSR rendering and head tags; sitemap.xml, robots.txt, JSON-LD structured data, and RSS feeds are explicit follow-ups. Auth-gated routes stay client-rendered with 200 plus noindex, and SSR HTML defaults to Cache-Control: no-cache because dehydrated state can be per-user.