Vue · VUE0013

Use useId for SSR-stable ids

Finds Vue SSR code that can be written with a clearer framework-supported pattern.
VUE0013vite-doctor/vuessrwarnSuggestion

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.

Use the Vue-supported use id for stable ids pattern instead.

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>
Copyright © 2026