Vue: [Vue warn]: Extraneous non-props attributes (class) were passed to component but could not be automatically inherited because component renders fragment or text root nodes
Attributes (class, style, listeners) passed to a component can't be applied because the component has multiple root nodes.
[Vue warn]: Extraneous non-props attributes (class) were passed to component but could not be automatically inherited because component renders fragment or text root nodes.Extraneous non-props attributes were passed to component but could not be automatically inherited[Vue warn]: Extraneous non-props attributes (style)Extraneous non-props attributes Meaning
Vue applies fallthrough attrs to a single root element. With multiple roots or a fragment, bind them manually: <div v-bind="$attrs"> or inheritAttrs: false with explicit placement. Wrap in a single root if simple.
Common causes
- Component template with multiple root elements
- Fragment/text root
inheritAttrs: falsewithout binding$attrs- Teleport/transition root
- Passing class/style to a multi-root component
⚡ Quick fix
- Wrap the template in one root element
- Use
v-bind="$attrs"on the intended element - Declare props/emits explicitly
Detailed fix by platform
Vue
<script setup>defineOptions({ inheritAttrs: false })</script><template><div class="wrap"><input v-bind="$attrs"></div></template>
How to diagnose
- Roots — Single?
- attrs — Bound?
- inheritAttrs — Set?
🔧 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]: Component emitted event but it is neither declared in the emits option nor as an onXxx prop Vue: [Vue warn]: Component emitted event "update" but it is neither declared in the emits option nor as an "onUpdate" prop
- [Vue warn]: injection "x" not found Vue: [Vue warn]: injection "theme" not found.
Most viewed in Vue
- Property was accessed during render but is not defined Vue: [Vue warn]: Property "x" was accessed during render but is not defined on instance
- Failed to resolve component Vue: [Vue warn]: Failed to resolve component: x
- 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