Vue · VUE0013
Use useId for SSR-stable ids
Finds Vue SSR code that can be written with a clearer framework-supported pattern.
vue/ssr/use-id-for-stable-idssrc/rule-packs/vue/rules/vue/prefer-use-id-for-stable-ids.ts Upstream docs Run this rule
pnpm vite-doctor . --framework vue --rules vue/ssr/use-id-for-stable-ids
Why it matters
Server-rendered markup must match the first client render. Browser-only state, time, randomness, or hash-sensitive URLs can create hydration mismatches.
Recommended fix
Use the Vue-supported use id for stable ids pattern instead.
Useful links
Example
Use stable IDs
Before
<script setup lang="ts">
const id = Math.random().toString(36)
</script>
After
<script setup lang="ts">
const id = useId()
</script>