
*By Sean Erick C. Ramones, Vue SME | JavaScript/TypeScript SME*
Sean Erick C. Ramones
In a Nuxt SSR application:
Step 3 is called hydration.
Hydration assumes that:
If they differ, Vue logs hydration warnings and may re-render parts of the DOM.
Hydration mismatches typically happen when server and client produce different output.
Common causes:
Example:
const id = Math.random()
Server and client generate different values.
const now = newDate().toISOString()
Server time and client time may differ by milliseconds or timezone.
window.innerWidth
This is undefined on the server.
Example:
If the condition is evaluated differently server vs client, mismatch occurs.
Hydration warnings are often ignored because the app still “works.”
However, consequences include:
In larger applications, hydration problems compound quickly.
Nuxt Hints is a Nuxt module designed to detect SSR and hydration pitfalls during development.
Instead of discovering hydration issues in production logs, developers get proactive hints in development.
Nuxt Hints analyzes your code and flags patterns that commonly cause hydration mismatches.
Examples of what it warns about:
Math.random() during renderDate in template setupwindow or document directlyuseStateIt acts as an early-warning system.
Component:
<scriptsetup>
const id = Math.random();
</script>
<template>
<div>{{ id }}</div>
</template>
Server generates:
0.48392
Client generates:
0.91837
Result:
Hydration mismatch.
Without tooling, this might go unnoticed.
Nuxt Hints detects the use of non-deterministic values during SSR and flags it during development.
Instead of debugging hydration logs later, the issue is identified immediately.
Correct pattern:
<script setup>
const id = useState("id", () => Math.random())
</script>
Now the value is generated once and shared between server and client.
Hydration bugs often appear only under specific conditions. Catching them during development lowers long-term maintenance cost.
Avoiding hydration mismatches prevents unnecessary DOM re-renders.
Teams become more conscious of:
This improves code quality overall.
As applications grow:
The risk of hydration drift increases.
Nuxt Hints acts as a guardrail.
Hydration awareness becomes critical when:
For internal tools with minimal SSR complexity, risk is lower.
For public-facing or SEO-heavy apps, risk is higher.
Since Preesh handles personalized content (thank-you cards, employee data, preview rendering, PDF export), consistency between server and client is critical.
Same goes for Roommejts where there are login/user states that should be handled both in the server layer to the client.
Using Nuxt Hints:
Given that we chose Nitro instead of a separate Express or Hono backend, tightening SSR discipline becomes even more important because everything lives in one runtime boundary.
It is a diagnostic tool, not a runtime patch.
Short term:
Add Nuxt Hints to all new Nuxt projects by default.
Medium term:
Audit existing SSR pages for hydration warnings.
Long term:
Establish internal SSR-safe development guidelines.
Hydration mismatches are one of the most common and under-discussed risks in SSR applications.
Nuxt provides powerful SSR capabilities, but those capabilities require deterministic rendering.
Nuxt Hints adds visibility and guardrails, helping teams prevent subtle bugs before they reach production.
It is a small addition that significantly improves long-term stability.