# no-undef-components

Rule `vue/no-undef-components`. Disallow use of undefined components in `<template>`

- Source: vue
- Technologies: Vue
- Kind: style
- Needs type information: no
- Autofix: no
- Reach: 0 weekly downloads of presets that enable it
- Trend: 0% last quarter
- Rank: #2073 by reach

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `vue/no-undef-components` | no | no | package `eslint-plugin-vue` | [docs](https://eslint.vuejs.org/rules/no-undef-components.html) |

## Code examples

### Incorrect: the rule reports this

```vue
  <Bar />
</template>
```

```vue
<template>
  <div>
    <h2>Lorem ipsum</h2>
    <TheModal />
  </div>
</template>

<script>
export default {
  components: {}
}
</script>
```

```vue
  <Bar />
</template>
```

### Correct: the rule accepts this

```vue
<Foo />
```

```vue
<template>
  <div>
    <h2>Lorem ipsum</h2>
    <the-modal>
      <component is="TheInput" />
      <component :is="'TheDropdown'" />
      <TheButton>CTA</TheButton>
    </the-modal>
  </div>
</template>

<script>
import TheButton from 'components/TheButton.vue'
import TheModal from 'components/TheModal.vue'
import TheInput from 'components/TheInput.vue'
import TheDropdown from 'components/TheDropdown.vue'

export default {
  components: {
    TheButton,
    TheModal,
    TheInput,
    TheDropdown,
  }
}
</script>
```

```vue
<CustomComponent />
```

Examples from the ESLint documentation.

## Enable it

### ESLint: `eslint.config.js`

```js
import vue from "eslint-plugin-vue";

export default [
  {
    plugins: { vue },
    rules: {
      "vue/no-undef-components": "error",
    },
  },
];
```

## Related rules

- [vue/no-static-inline-styles](https://lintradar.dev/rules/vue/no-static-inline-styles.md): Disallow static inline `style` attributes
- [vue/no-unsupported-features](https://lintradar.dev/rules/vue/no-unsupported-features.md): Disallow unsupported Vue.js syntax on the specified version
- [vue/no-restricted-static-attribute](https://lintradar.dev/rules/vue/no-restricted-static-attribute.md): Disallow specific attribute
- [vue/no-unused-properties](https://lintradar.dev/rules/vue/no-unused-properties.md): Disallow unused properties
- [vue/no-restricted-props](https://lintradar.dev/rules/vue/no-restricted-props.md): Disallow specific props
- [vue/no-useless-mustaches](https://lintradar.dev/rules/vue/no-useless-mustaches.md): Disallow unnecessary mustache interpolations

---

Web page: https://lintradar.dev/rules/vue/no-undef-components. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
