# Vue: [Vue warn]: Component is missing template or render function.

**Code:** `[Vue warn]: Component is missing template or render function` · **Category:** Vue · **Seen on:** Vue

A component object has neither `template` nor `render`, or an SFC import resolved wrongly.

## Meaning

Typical causes: importing a `.vue` file without the Vue plugin/loader, importing the wrong thing (a module namespace or `defineComponent` result missing template), `template` string with the runtime-only build, or forgetting `export default`. Check `import X from './X.vue'` returns a component.

## Common causes

- SFC not compiled (plugin/loader missing)
- Importing the namespace/wrong export
- Runtime-only build with `template:` strings
- Empty component definition
- Async component resolving to a module object

## Quick fix

1. Install/configure `@vitejs/plugin-vue`/`vue-loader`
2. `import X from "./X.vue"` (default)
3. Use a build with the compiler or render functions

## Detailed fix by platform

### Vue

1. 

```javascript
// vite.config.ts
import vue from "@vitejs/plugin-vue"; export default { plugins: [vue()] };
```


## How to diagnose

1. **Plugin** — Configured?
2. **Import** — Default component?
3. **Build** — Compiler?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/vue/vue-warn-component-missing-template-or-render-function)
