Question
Error: Hydration failed because the initial UI does not match what was rendered on the server – Remix loader after schema change
Tasadduq BurneyownerOwner · Founder
20.1K reputation · 12 Sept 2024, 23:02 UTC
60.4K views0
Hydration mismatch after schema change and action failure
The goal is to understand whether Remix should automatically revert loader data to its pre‑mutation state when an action throws an error, thereby avoiding a hydration mismatch that occurs when the loader returns a shape altered by a schema change.
Constraints include maintaining developer control over error handling, ensuring compatibility across Remix v1 and v2, and not interfering with custom error boundaries or useTransition hooks that already manage rollback logic.
- Should Remix provide a built‑in rollback of loader data on action failure, or leave this entirely to application code?
- If automatic rollback is added, how should it interact with existing error boundaries and the useTransition hook?
- What version‑specific considerations (v1 vs v2) must be evaluated before changing the default behavior?