v-else/v-else-if has no adjacent v-if Vue Origin: On your device OSI layer 7 · Application Last updated 5 Nov 2026

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.

Exact message you may see [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
Seen on: Vue

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

  1. Place v-else immediately after the v-if sibling
  2. Use <template v-if>/<template v-else> for groups
  3. Check v-else-if spelling

Detailed fix by platform

Vue

  1. <p v-if="a">A</p><p v-else-if="b">B</p><p v-else>C</p>

How to diagnose

  1. Siblings — Adjacent?
  2. Typo — v-else-if?
  3. 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:

Where this error sits

Origin: On your device. Errors that are often confused with or caused by this one (click to open):

Duplicate attribute (Vue template) — Vue: [plugin:vite:vue] Duplicate attribute. / [vue/no-duplicate-attributes] Duplicate attribute 'class' (Vue)Duplicate attribute (…Element is missing end tag — Vue: [plugin:vite:vue] Element is missing end tag. / Invalid end tag. (Vue)Element is missing en…ESLint Parsing error in .vue files — ESLint: Parsing error: Unexpected token < / Parsing error: '>' expected (vue-eslint-parser not configured) (Vue)ESLint Parsing error …Property was accessed during render but is not defined — Vue: [Vue warn]: Property "x" was accessed during render but is not defined on instance (Vue)Property was accessed…Tags with side effect (<script>/<style>) are ignored in client component templates — Vue: [Vue warn]: Template compilation error: Tags with side effect (<script> and <style>) are ignored in client component templates (Vue)Tags with side effect…v-if with v-for on the same element — Vue: [vue/no-use-v-if-with-v-for] / Vue 3: v-if has higher priority than v-for — property accessed during render is undefined (Vue)v-if with v-for on th…Vite: Failed to parse source / Unknown file extension ".vue" — Vite/Vue: [plugin:vite:import-analysis] Failed to parse source for import analysis — you may need to install appropriate plugins to handle the .vue file format (Vue)Vite: Failed to parse…v-else/v-…

Explore the map of this error Full error map →

🧠 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.