Skip to content

Fix theme and sidebar hydration#866

Merged
miurla merged 1 commit into
mainfrom
theme-hydration-fix
May 24, 2026
Merged

Fix theme and sidebar hydration#866
miurla merged 1 commit into
mainfrom
theme-hydration-fix

Conversation

@miurla
Copy link
Copy Markdown
Owner

@miurla miurla commented May 24, 2026

Summary

  • Replace the theme provider with a local implementation that inserts the initial theme script through server-inserted HTML.
  • Move theme consumers to the local hook and remove the unused theme package.
  • Isolate the sidebar New link in a client component to avoid hydration mismatches at the server/client boundary.

Root Cause

The previous theme package rendered an inline script inside the React tree, which can trigger React 19 script and hydration warnings. The sidebar mismatch came from passing a Next link through a client Slot component across a server component boundary.

Validation

  • bun typecheck
  • bun lint
  • prettier check on changed files
  • bun run test
  • bun run build
  • Fresh local navigation showed no new browser error or warning logs.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 24, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
morphic Ready Ready Preview, Comment May 24, 2026 3:02am

@miurla miurla marked this pull request as ready for review May 24, 2026 03:02
@miurla miurla merged commit f2d83a1 into main May 24, 2026
8 checks passed
@miurla miurla deleted the theme-hydration-fix branch May 24, 2026 03:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant