Vue: [Vue warn]: Failed to resolve component: x
The template uses a component tag that isn’t registered or imported where it’s used.
Seen on:
Vue
Meaning
In Vue 3, components must be imported in <script setup> (or registered locally/globally). Name casing, missing auto-import config, or custom elements not declared also cause it.
Common causes
- Component not imported in <script setup>
- Typo/casing in the tag name
- Global registration missing (app.component)
- Web component not configured as custom element
⚡ Quick fix
- Import the component in the SFC
- Check the file/tag name
- Configure compilerOptions.isCustomElement for web components
Detailed fix by platform
Vue
- javascript
<script setup> import UserCard from "@/components/UserCard.vue"; </script> <template><UserCard :user="user" /></template>
How to diagnose
- Import — Present?
- Name — Matches tag?
- Nuxt — Auto-import directory?
🔧 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
- 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
- Property was accessed during render but is not defined Vue: [Vue warn]: Property "x" was accessed during render but is not defined on instance
- refs on function components Warning: Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?
Other ways to find it
🧠 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.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 7 Oct 2026