[Solved] element-plus Error: Failed to resolve component

vue3 & element-plus Project Error:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
Failed to resolve component: el-form If this is a native custom element, make sure to exclude it
Failed to resolve component: el-form If this is a native custom element, make sure to exclude it
Failed to resolve component el-form-item
Failed to resolve component Descriptions
Component inside <Transition> renders non-element root node that cannot be animated.
Failed to resolve component: el-form If this is a native custom element, make sure to exclude it Failed to resolve component: el-form If this is a native custom element, make sure to exclude it Failed to resolve component el-form-item Failed to resolve component Descriptions Component inside <Transition> renders non-element root node that cannot be animated.
Failed to resolve component: el-form If this is a native custom element, make sure to exclude it
Failed to resolve component: el-form If this is a native custom element, make sure to exclude it
Failed to resolve component el-form-item
Failed to resolve component Descriptions
Component inside Transition renders non-element root node that cannot be animated.

Reason:
On-demand introduction of element

Solution:
1. Enter in the page script

import { ElForm } from "element-plus";

2. Add commonly used ones to element-plus files

import {
    ElForm,
}

const components = [
    ElForm,
]

Done!

Read More: