Subscribe on changes!

When editing static nodes used in `v-for`, HMR doesn't work well

avatar
Nov 15th 2022

Vue version

3.2.45

Link to minimal reproduction

https://stackblitz.com/edit/vitejs-vite-fetypr?file=src%2FApp.vue,src%2Fx.vue&terminal=dev

Steps to reproduce

  1. Open reproduction.
  2. Run npm i and npm run dev
  3. Replace Best blog about in x.vue with Best blog abouta

What is expected?

The following content to be shown.

Best blog abouta

changeMechangeMechangeMe

Best blog abouta

changeMechangeMechangeMe

What is actually happening?

The following content was shown.

Best blog about

changeMechangeMechangeMe

Best blog abouta

changeMechangeMechangeMe

Best blog abouta

changeMechangeMechangeMe

System Info

No response

Any additional comments?

If you replace x.vue with the following code and re-run npm dev,

<template>
  <div>
    <p class="m-0">Best blog about</p>
  </div>
</template>

when you replace Best blog about with Best blog abouta, only the second Best blog about is replaced.


Original issue: https://github.com/vitejs/vite/issues/6769

avatar
Nov 15th 2022

Seems like a duplicate of #6978