vueComponent / ant-design-vue

🌈 An enterprise-class UI components based on Ant Design and Vue. 🐜
https://antdv.com/
Other
20.14k stars 3.78k forks source link

@vue/cli 4.2 无法启动 #1958

Closed zlab closed 4 years ago

zlab commented 4 years ago

Version

1.4.12

Environment

Mac chrome80, vue 2.6.11

"dependencies": {
    "ant-design-vue": "^1.4.12",
    "core-js": "^3.6.4",
    "vue": "^2.6.11"
  },
  "devDependencies": {
    "@vue/cli-plugin-babel": "~4.2.0",
    "@vue/cli-plugin-eslint": "~4.2.0",
    "@vue/cli-service": "~4.2.0",
    "babel-eslint": "^10.0.3",
    "eslint": "^6.7.2",
    "eslint-plugin-vue": "^6.1.2",
    "vue-template-compiler": "^2.6.11"
  },

Reproduction link

https://cli.vuejs.org/guide/creating-a-project.html

Steps to reproduce

// 增加以下两行代码 import { Button } from 'ant-design-vue'; Vue.use(Button);

Vue.config.productionTip = false;

new Vue({ render: h => h(App), }).$mount('#app');


### yarn serve 无法启动了
如果不能复现问题,执行`yarn upgrade`,再启动

### What is expected?
正常启动

### What is actually happening?

/usr/local/bin/node /Users/zhanqi/.config/yarn/global/node_modules/yarn/bin/yarn.js run serve yarn run v1.22.4 $ vue-cli-service serve INFO Starting development server...

ERROR Failed to compile with 7 errors 12:18:13 PM

These dependencies were not found:

To install them, you can run: npm install --save core-js/library/fn/array/from core-js/library/fn/get-iterator core-js/library/fn/is-iterable core-js/library/fn/object/assign core-js/library/fn/object/define-property core-js/library/fn/symbol core-js/library/fn/symbol/iterator

Process finished with exit code 2



<!-- generated by issue-helper. DO NOT REMOVE -->
brandon3343 commented 4 years ago

这个看起来好像是core-js没装好吧,重新安装下试试?

anncwb commented 4 years ago

babel配置问题 可以直接在main.js引入 这两行 import 'core-js/stable'; import 'regenerator-runtime/runtime'; 试看看

anncwb commented 4 years ago

最顶部引入

zlab commented 4 years ago

@l619534951 重试无数次了,删了yarn.lock,重装,没用

tangjinzhou commented 4 years ago

哪来的 'core-js/stable'

zlab commented 4 years ago

@tangjinzhou 重现了吗,急啊

// 注释以下两行代码就能正常启动
import { Button } from 'ant-design-vue';
Vue.use(Button);
zlab commented 4 years ago

@sendya 老大能帮忙看看吗?

sendya commented 4 years ago

@sendya 老大能帮忙看看吗?

提供复现仓库

zlab commented 4 years ago

https://github.com/zlab/antdv-issue1

yarn

zlab commented 4 years ago

vue-cli 4.3 已修复此问题

ITHcc commented 3 years ago

我用@vue/cli-service-global创建了一个快速原型开发项目,在引入ant-design-vue后,也出现了这个报错

ITHcc commented 3 years ago

@zlab

github-actions[bot] commented 2 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.