Skip to content

[BUG] Hydration error when switching between Dark/Light theme #610

@aasthamewar

Description

@aasthamewar

Platform

Window 11

Browser

Brave

Current Behavior

When switching between Dark and Light themes, the application throws a hydration error.
The server renders "Dark" by default, but the client re-renders as "Light", causing a mismatch.
This results in a console warning:

"Hydration failed because the server rendered text didn't match the client."

Expected Behavior

The theme toggle should render consistently across server and client.
Switching themes should not cause hydration errors, and the text should match between server and client ("Dark" or "Light").

Recurrence Probability

Always

Steps To Reproduce

  1. Run the application in development mode.
  2. Open the app in Brave browser (Windows 11).
  3. Toggle between Dark and Light themes.
  4. Open the console and observe the hydration error.

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions