Vue: [plugin:vite:vue] Duplicate attribute. / [vue/no-duplicate-attributes] Duplicate attribute 'class'
The same attribute appears twice on an element in a template.
[plugin:vite:vue] Duplicate attribute.Duplicate attribute.[vue/no-duplicate-attributes] Duplicate attribute 'class'Duplicate attribute 'id' Vue template Meaning
Merge them: for class/style use a single binding or :class="['a', b]"; class="a" :class="b" is allowed (static + bound), but two static class attributes are not. Remove duplicates of props and event listeners.
Common causes
- Two static
classoridattributes - Duplicate prop pass-through
- Copy-paste error
- Conflicting v-bind object with explicit attr
- Lint rule flagging duplicates
⚡ Quick fix
- Combine into one attribute
- Use
:class="[...]"arrays - Remove the duplicate
Detailed fix by platform
Vue
<div class="card" :class="{ active: isActive }">
How to diagnose
- Attribute — Duplicate?
- Merge — Array binding?
- Props — Repeated?
🔧 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
- [Vue warn]: <TransitionGroup> children must be keyed Vue: [Vue warn]: <TransitionGroup> children must be keyed: <li>
- [Vue warn]: Failed to locate Teleport target with selector Vue: [Vue warn]: Failed to locate Teleport target with selector "#modal". Note the target element must exist before the component is mounted
- Cannot find module './App.vue' or its corresponding type declarations TypeScript: error TS2307: Cannot find module './App.vue' or its corresponding type declarations.
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