element-plus: [Bug Report] Component is missing template or render function.

Element Plus version

1.1.0-beta.21

OS/Browsers version

Vue version

3.2.20

Reproduction Link

https://codesandbox.io/embed/element-plus-spa-forked-vkdgb?fontsize=14&hidenavigation=1&theme=dark

Steps to reproduce

  1. here is my package.json
{
  "scripts":{
    "build": "vue-tsc --noEmit --skipLibCheck && vite build"
  },
  "dependencies": {
    "@element-plus/icons": "0.0.11",
    "@vitejs/plugin-vue-jsx": "^1.1.8",
    "element-plus": "=1.1.0-beta.21",
    "vue": "^3.2.19",
  },
  "devDependencies": {
    "@types/node": "^16.7.6",
    "@vitejs/plugin-vue": "^1.6.0",
    "@vue/compiler-sfc": "^3.0.5",
    "autoprefixer": "^10.3.3",
    "postcss": "^8.3.6",
    "sass": "^1.38.2",
    "typescript": "^4.3.2",
    "vite": "^2.5.1",
    "vite-plugin-element-plus": "0.0.12",
    "vue-tsc": "^0.2.2"
  }
}
  1. here is the code in ‘src/App.vue’
<template>
  <el-main>
    <div>hello world</div>
  </el-main>
</template>
  1. when I packed and opened it in chrome, the page is empty. here is the console.warning
   [Vue warn]: Component is missing template or render function. 
  at <ElMain> 
  at <Anonymous> 
  at <App>
  1. the truth is every component in Element-plus cannot be recognized.

  2. There was no problem with the last version

What is Expected?

no error

What is actually happening?

every component in Element-plus can be recognized, and rendered

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 4
  • Comments: 18 (8 by maintainers)

Most upvoted comments

Updates:

Found the root cause, going to fix it ASAP.

已经找到了出问题的地方,会马上修复。🙏

Sorry again for the inconvenience that we caused 🙇

@alanleung04 我们已经定位到问题并且进行修复了字体的这个问题,现在在排查 prod 环境缺失 render 函数的问题,带来不便实在抱歉 🙇

@phillyx @languanghao May I ask which bundler you are using? Webpack or Vite?

vite&rollup

Hi, 我们会赶紧调查因为什么,最近确实对打包脚本做了改动,如果短期调查不出原因我们会马上 rollback

"element-plus": "=1.1.0-beta.20"

=20可以解决

再生产环境中会有这个问题,开发环境中没有