dargmuesli / nuxt-cookie-control

A highly configurable cookie banner for Nuxt.
MIT License
248 stars 46 forks source link

Hydration error after accepting/declining cookie banner on generated static sites #239

Open codeflorist opened 22 hours ago

codeflorist commented 22 hours ago

Environment


Reproduction

https://stackblitz.com/edit/nuxt-starter-kulhpc?file=app.vue

Describe the bug

First of all many thanks for this great module!

Here are the steps required to reproduce this bug:

  1. Generate a static site using nuxt generate.
  2. Preview the site using nuxt preview.
  3. Accept or Decline the cookie banner.
  4. Reload the page.
  5. The console shows the error Hydration completed but contains mismatches.

Note: Due to https://github.com/stackblitz/webcontainer-core/issues/1439 nuxt preview is not working on the stackblitz (possibly only on Windows). So it's best to download the reproduction. But the problem should basically be reproducable on every project.

Additional context

No response

Logs

No response