Vue · Template
Reports v-for elements without a key when an item holds state: a component whose source keeps local state, an element with v-model, a native form control, or a child of <TransitionGroup>. Unkeyed lists of stateless elements are not reported.
vite-doctor/vuetemplatewarnNo fix
Why it happens
Without a key, Vue patches a v-for list in place. When items are inserted, removed or reordered, each component instance and form control stays at its position, so local state, typed input and focus end up on a different item, and <TransitionGroup> does not animate unkeyed children at all.
Fix
Bind
Example
Key a component list by item id
Before
<script setup lang="ts">
import TodoRow from "./TodoRow.vue"; // keeps a draft in ref()
</script>
<template>
<TodoRow v-for="todo in todos" :todo="todo" />
</template>
After
<script setup lang="ts">
import TodoRow from "./TodoRow.vue"; // keeps a draft in ref()
</script>
<template>
<TodoRow v-for="todo in todos" :key="todo.id" :todo="todo" />
</template>
Verify the fix
Run only this rule after editing so the report stays focused on the diagnostic you are closing:
pnpm vite-doctor . --framework vue --rules vue/template/require-v-for-key