在 vue.js 中安装 vuetify 后,新项目无法编译 [英] Fresh project fail to compile after installing vuetify in vue.js

查看:108
本文介绍了在 vue.js 中安装 vuetify 后,新项目无法编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 vue.js 中遇到问题,我使用 webstorm 创建了一个新项目,它运行完全没有问题,我可以看到 vue 徽标.在下一步中,我想安装 vuetify,但出现如下错误列表:

<块引用><块引用>

编译失败.

./src/plugins/vuetify.js 模块未找到:错误:无法解析
我的项目路径"中的vuetify/lib"

类型错误:无法读取未定义的属性匹配"错误类型错误:无法读取未定义的属性匹配"类型错误:无法读取未定义的属性匹配"在 VuetifyLoaderPlugin.apply (/home/tina/WebstormProjects/tinalasttry/node_modules/vuetify-loader/lib/plugin.js:28:29)在 webpack (/home/tina/WebstormProjects/tinalasttry/node_modules/webpack/lib/webpack.js:51:13)在服务(/home/tina/WebstormProjects/tinalasttry/node_modules/@vue/cli-service/lib/commands/serve.js:161:22)在 processTicksAndRejections (internal/process/task_queues.js:93:5)

我已经使用命令 add vuetify 安装了 vuetify,我也尝试从 vue ui 安装它.我之前安装过 vuetify 没有问题,我检查了任何版本更改或更新,但它们都是相同的,但现在无法安装在全新的项目中.

 vuetify.js从'vue'导入Vue;从 'vuetify/lib' 导入 Vuetify;Vue.use(Vuetify);导出默认的新 Vuetify({});

解决方案

编辑 plugins.js 以解决问题(临时)

 构造函数(选项){this.options = (选项) ?选项 : {}}

来源:https://github.com/vuetifyjs/vuetify-loader/pull/97#issuecomment-557767269

i have a problem in vue.js, i have created a new project using webstorm and it runs with no problem at all and i can see vue logo. in next step i want to install vuetify but i get errors as below list:

Failed to compile.

./src/plugins/vuetify.js Module not found: Error: Can't resolve
'vuetify/lib' in 'PATH TO MY PROJECT'

TypeError: Cannot read property 'match' of undefined ERROR TypeError: Cannot read property 'match' of undefined TypeError: Cannot read property 'match' of undefined at VuetifyLoaderPlugin.apply (/home/tina/WebstormProjects/tinalasttry/node_modules/vuetify-loader/lib/plugin.js:28:29) at webpack (/home/tina/WebstormProjects/tinalasttry/node_modules/webpack/lib/webpack.js:51:13) at serve (/home/tina/WebstormProjects/tinalasttry/node_modules/@vue/cli-service/lib/commands/serve.js:161:22) at processTicksAndRejections (internal/process/task_queues.js:93:5)

i have installed vuetify using command add vuetify and also i tried installing it from vue ui. i have installed vuetify before with no problem and i checked for any version changes or updates but they are all same but now cant install in a fresh and new project.

 vuetify.js

    import Vue from 'vue';
    import Vuetify from 'vuetify/lib';

    Vue.use(Vuetify);

    export default new Vuetify({
    });

解决方案

Edit plugins.js to fix the issue (temporary)

  constructor (options) {
    this.options = (options) ? options : {}
  }

Source: https://github.com/vuetifyjs/vuetify-loader/pull/97#issuecomment-557767269

这篇关于在 vue.js 中安装 vuetify 后,新项目无法编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆