Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Component] [All] Failed to resolve component: el-button If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement. #16918

Open
wade3po opened this issue May 20, 2024 · 1 comment

Comments

@wade3po
Copy link

wade3po commented May 20, 2024

Bug Type: Component

Environment

  • Vue Version: 3.4.21
  • Element Plus Version: 2.7.3
  • Browser / OS: chrom 版本 126.0.6423.2(正式版本) (64 位)
  • Build Tool: Vite

Reproduction

Related Component

  • All

Reproduction Link

Github Repo

Steps to reproduce

node 18.12.1
npm create vite@latest
vue
typescript
npm install element-plus --save
npm install -D unplugin-vue-components unplugin-auto-import

// vite.config.ts
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import AutoImport from "unplugin-auto-import/vite";
import Components from "unplugin-vue-components/vite";
import { ElementPlusResolver } from "unplugin-vue-components/resolvers";

// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
AutoImport({
resolvers: [ElementPlusResolver()],
}),
Components({
resolvers: [ElementPlusResolver()],
}),
],
});

What is Expected?

自动导入组件

What is actually happening?

vue.js?v=635cc2bb:1512 [Vue warn]: Failed to resolve component: el-button
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.
at

Additional comments

换了node版本也一样,是否是vite版本和element-plus版本有兼容问题

@btea
Copy link
Collaborator

btea commented May 21, 2024

My local environment is normal, and my node version is 18.19.1.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants