webdev-ssr-conversion

Convert a React 19 + Vite + Express + tRPC SPA into a server-side rendered app.

Updated Sep 16, 2026
One-click install
npx skills add https://github.com/Military-Veteran-Team-LPT-Realty/mvt-manus-public-skills --skill webdev-ssr-conversion-military-veteran-team-lpt-realty
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: webdev-ssr-conversion
Source: https://github.com/Military-Veteran-Team-LPT-Realty/mvt-manus-public-skills/tree/main/skills/webdev-ssr-conversion
Command: npx skills add https://github.com/Military-Veteran-Team-LPT-Realty/mvt-manus-public-skills --skill webdev-ssr-conversion-military-veteran-team-lpt-realty

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Client-rendered single-page apps built on the Manus web-db-user template serve an empty HTML shell to crawlers and social scrapers, so pages are invisible to search engines and link previews render blank. This Skill converts that template into a server-side rendered app with per-route titles, meta tags, and real HTTP status codes. ## Core Features & Use Cases - Full SSR conversion checklist: Split client/server entries, prefetch tRPC queries into a dehydrated TanStack Query cache, and wire Express to compose and serve rendered HTML without changing any page component or design. - SEO parity built in: Per-route title, description, Open Graph, Twitter Card, canonical tags, real 404 status codes, and noindex handling for auth-gated routes. - Pitfall reference and verification harness: A catalog of observed failures (hydration mismatches, browser-global crashes, build misconfigurations) plus a curl-based script that asserts crawler-visible output per route. - Use Case: A storefront built on the Manus full-stack template needs Google to index its product pages and social platforms to render link-preview cards; follow the checklist to convert it to SSR and verify every route class with the bundled script. ## Quick Start Ask the AI to convert this Manus web-db-user template project to server-side rendering so crawlers see fully populated pages, then run the verification script against the production build.

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) and entry-client.tsx (hydrateRoot), prefetch each route's queries into a QueryClient, dehydrate and embed the state in the HTML, and have Express compose per-route head tags. The Skill's checklist walks through each file for the Manus template.

How do I make tRPC queries work with SSR prefetching?

Build an in-process caller with appRouter.createCaller(ctx) so SSR calls procedures as plain functions while keeping ctx.user from the cookie. Seed results into the query cache with getQueryKey using the exact input shape the component's useQuery produces.

Does this SSR conversion work with Next.js or Remix apps?

No. It targets only the Manus web-db-user template: React 19, Vite 7, Express 4, tRPC 11, wouter, TanStack Query 5, and superjson. Next.js, Remix, and Astro 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 the server render. Guard app code with typeof window checks, and keep dependencies that touch window at module scope out of the server import graph.

Why do hydrated pages refetch data and flash after SSR?

TanStack Query v5 defaults staleTime to 0, so hydrated data is instantly stale and refetches on mount. Set a staleTime on the client QueryClient and ensure prefetched query keys exactly match the component's useQuery input, including types and URL decoding.

When should a route return 404 versus a 200 shell in SSR?

Only a genuine miss (null result or NOT_FOUND error) may return 404 with noindex; transient backend errors must degrade to the 200 shell or crawlers will deindex real pages. Auth-gated routes return 200 with default head and noindex, never prefetched private data.