nuxt-ssr-lit icon indicating copy to clipboard operation
nuxt-ssr-lit copied to clipboard

"Hydration value mismatch" during conditional rendering

Open xander-marjoram opened this issue 7 months ago • 1 comments

Describe the bug When using the contents of an object prop to conditionally render elements, hydration fails due to a mismatch error. A fuller description with a code example is available in this minimal reproduction: https://github.com/xander-marjoram/nuxt-lit-ssr-issue-repro

To Reproduce Steps to reproduce the behavior:

  1. Clone the above repo.
  2. Follow the readme instructions to install and set up.
  3. Build and run the app.
  4. You should see the hydration mismatch error in the browser console (screenshot below).

Expected behavior When SSR is enabled, the prop should have the correct value when rendering on the client. Ideally, there should then be no mismatch, and hydration should succeed without error.

Screenshots 2024-07-22 13_24_32

  • Nuxt version: ^3.12.3 (see package.json of linked repo for more deps).
  • Affects latest Chrome, Firefox, Safari, Edge.

xander-marjoram avatar Jul 22 '24 12:07 xander-marjoram