Nuxt · Browser APIs
NUXT0067Use VueUse storage composables
Finds VueUse project code that should use the supported use storage pattern instead.
vite-doctor/vueusebrowser-apiinfoSuggestion
Why it happens
Manual storage reads and watches duplicate serialization, cross-tab synchronization, default handling, and reactive updates already handled by useStorage().
Fix
Use VueUse useLocalStorage() or useSessionStorage() for client storage so refs, serialization, and cleanup stay together. In SSR apps, pass { initOnMounted: true } so the first client render matches the server, or use useCookie() for state the server must render.
Example
Use VueUse storage
Before
const theme = ref(localStorage.getItem('theme') || 'light')
watch(theme, value => localStorage.setItem('theme', value))
After
const theme = useLocalStorage('theme', 'light', { initOnMounted: true })
Verify the fix
Run only this rule after editing so the report stays focused on the diagnostic you are closing:
pnpm nuxt doctor --rules vueuse/prefer-use-storage