Skip to content

v-html not getting hydrated/updated on prerendered site #22784

Description

@codeflorist

Environment


  • Operating System: Linux
  • Node Version: v16.20.0
  • Nuxt Version: 3.6.5
  • Nitro Version: 2.6.0
  • Package Manager: npm@9.4.2
  • Builder: vite
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

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

Describe the bug

Using v-html on a prerendered site will result in the html not getting updated after hydration.

Here is the example used in the stackblitz:

<script setup>
const timestamp = ref();
timestamp.value = Date.now();
</script>
<template>
  <div>
    <div v-html="timestamp" />
    {{ timestamp }}
  </div>
</template>

After loading the prerendered site, the timestamp in the v-html ist not getting updated, but stays with the value it was prerendered with. I would expect that div to update to the current timestamp on every pageload.

Additional context

No response

Logs

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions