Skip to content

chore: hydration-issue warning due to SSR generated DateTime value#535

Merged
harlan-zw merged 2 commits intonuxt-modules:mainfrom
khatastroffik:khatastroffik-patch-1
Mar 26, 2026
Merged

chore: hydration-issue warning due to SSR generated DateTime value#535
harlan-zw merged 2 commits intonuxt-modules:mainfrom
khatastroffik:khatastroffik-patch-1

Conversation

@khatastroffik
Copy link
Copy Markdown
Contributor

The potential difference between server and client time is not important here (and the gap wouldn't occur very often and correspond to a neglectable difference).

🔗 Linked issue

see the annotations in the CI lint action log.

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

Add data-allow-mismatch="attribute" html attribute to avoid the hydration-issue warning.

An alternative would be to generate the title using useState("og-image-without-cache", () => new Date())... or a <ClientOnly> or similar approach.

…ng due to datetime value

The potential difference between server and client time is not important here (and seldom occurs).
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 25, 2026

Open in StackBlitz

npm i https://pkg.pr.new/nuxt-og-image@535

commit: 1c6cab4

@harlan-zw
Copy link
Copy Markdown
Collaborator

Thanks :)

@harlan-zw harlan-zw merged commit 92d9dac into nuxt-modules:main Mar 26, 2026
2 checks passed
@harlan-zw harlan-zw changed the title fix: hydration-issue warning due to SSR generated DateTime value chore: hydration-issue warning due to SSR generated DateTime value Mar 26, 2026
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.

2 participants