The SSR Tradeoffs Nobody Warns You About
SSR is great for SEO and first paint — but it changes how you think about state, auth, and analytics. Here's what I learned the slow way.
SSR isn't a free upgrade. It's a different runtime model — and if you treat it like a sticker you add to a Vite app, you'll hit subtle issues for weeks.
Issue one: window. Anything that touches window, localStorage or document at module scope crashes on the server. Move it inside useEffect or wrap with a typeof guard.
Issue two: auth. Your session cookie is on the request, not in localStorage. Loaders must read from the request context — not call a client SDK.
Issue three: analytics. Page views fire on the client after hydration. Don't double-count by also firing in a server loader.
Done right, SSR pays off. Done blindly, it doubles your error budget. Go in with eyes open.