Vue: [plugin:vite:vue] v-else/v-else-if has no adjacent v-if or v-else-if.
A v-else element isn't directly after a v-if/v-else-if sibling.
[plugin:vite:vue] v-else/v-else-if has no adjacent v-if or v-else-if.v-else/v-else-if has no adjacent v-if[vue/valid-v-else] 'v-else' directives require being preceded by the element which has a 'v-if'Vue compile error v-else no adjacent v-if Meaning
Keep the chain contiguous: no other elements (or comments in some cases) between v-if and v-else. Wrap blocks in <template> if you need multiple elements, and don't put v-else on a root without a matching v-if sibling.
Common causes
- Element inserted between v-if and v-else
- v-else at the start/without v-if
- Whitespace-only comments with condense
- Different parents
- Typo (
v-else if)
⚡ Quick fix
- Place
v-elseimmediately after thev-ifsibling - Use
<template v-if>/<template v-else>for groups - Check
v-else-ifspelling
Detailed fix by platform
Vue
<p v-if="a">A</p><p v-else-if="b">B</p><p v-else>C</p>
How to diagnose
- Siblings — Adjacent?
- Typo — v-else-if?
- Group — template?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- Duplicate attribute (Vue template) Vue: [plugin:vite:vue] Duplicate attribute. / [vue/no-duplicate-attributes] Duplicate attribute 'class'
- Element is missing end tag Vue: [plugin:vite:vue] Element is missing end tag. / Invalid end tag.
- ESLint Parsing error in .vue files ESLint: Parsing error: Unexpected token < / Parsing error: '>' expected (vue-eslint-parser not configured)
Most viewed in Vue
- Failed to resolve component Vue: [Vue warn]: Failed to resolve component: x
- Avoid mutating a prop directly Vue: [Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders
- Nuxt: window/document/localStorage is not defined (SSR) Nuxt: ReferenceError: window is not defined / 500 Internal Server Error during SSR
Other ways to find it
Where this error sits
Origin: On your device. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 5 Nov 2026