ElemeFE / element

A Vue.js 2.0 UI Toolkit for Web
https://element.eleme.io/
MIT License
54.12k stars 14.64k forks source link

[bug report] vue-cli @ 3 official document configuration on demand reference, babel-plugin-component needs to be reinstalled to load successfully #18801

Open menghuanCode opened 4 years ago

menghuanCode commented 4 years ago

Element UI version

2.13.0

OS/Browsers version

window10/ 76.0.3809.132 (64 位)

Vue version

2.6.11

Reproduction Link

https://github.com/menghuanCode/element-issue

Steps to reproduce

  1. vue create . (create a project) 使用 Vue-cli@3 创建一个项目
  2. npm install element-ui
  3. npm install babel-plugin-component -D
  4. update babel.config.js
module.exports = {
  presets: [  '@vue/cli-plugin-babel/preset' ],
  plugins: [
    [ "component",
      {
        "libraryName": "element-ui",
        "styleLibraryName": "theme-chalk"
      }
    ]
  ]
}

What is Expected?

Run successfully 运行成功

What is actually happening?

ERROR  Failed:
This dependency was not found:
* core-js/modules/es.object.to-string in ./src/router/index.js
To install it, you can run: npm install --save core-js/modules/es.object.to-string

Need to reinstall babel-plugin-component to run successfully (需要重新安装 babel-plugin-component 才能运行成功)

I don't know what happened during this time (我不知道这段时间发生了什么)

I konw vue-cli-plugin-element can use (我知道有 vue-cli-plugin-element 可以使用)

I am out of curiosity 我出于好奇

element-bot commented 4 years ago

Translation of this issue:

Element UI version

2.13.0

OS/Browsers version

Windows10 / 76.0.3809.132 (64 bit)

Vue version

2.6.11

Reproduction Link

https://github.com/menghuanCode/element-issue

Steps to reproduce

  1. vue create . (create a project)

Create a project using vue-cli @ 3

  1. npm install element-ui

  2. npm install babel-plugin-component -D

  3. update babel.config.js


module.exports = {

presets: [  '@vue/cli-plugin-babel/preset' ],
Plugins: [

[ "component",
{

"libraryName": "element-ui",
"styleLibraryName": "theme-chalk"

}
]

]
}

` ` ` `
### What is Expected?

Run successfully
Successful operation

### What is actually happening?
```txt

ERROR  Failed:
This dependency was not found:

* core-js/modules/es.object.to-string in ./src/router/index.js
To install it, you can run: npm install --save core-js/modules/es.object.to-string

` ` ` `
Need to reinstall babel-plugin-component to run successfully

(Babel plugin component needs to be reinstalled to run successfully)
I don't know what happened during this time

(I don't know what happened during this period)
I konw vue-cli-plugin-element can use

(I know there is Vue cli plugin element available)
I am out of curiosity

I'm curious
stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.