1

I have this error Failed to compile. ./src/main.js Module not found: Error: Can't resolve '.plugins/vuetify' in 'C:\vue\testvueapp\src' but I have installed it enter image description here

and this is my main.js

import Vue from 'vue';
import App from './App.vue';
import vuetify from '.plugins/vuetify';

Vue.config.productionTip = false;

new Vue({
 vuetify,
 render: (h) => h(App),
}).$mount('#app');
Steve
  • 2,963
  • 15
  • 61
  • 133

3 Answers3

1

Seems like path issue. tryout below

import vuetify from '@/plugins/vuetify'
ImZedi
  • 294
  • 4
  • 15
1

Use

import vuetify from './plugins/vuetify'

Notice the slightest of path difference before plugins here

BeaST 30
  • 696
  • 1
  • 10
  • 22
  • what if it is in node_modules folder? – Steve Jun 01 '20 at 08:30
  • 1
    Generally, it would also have been declared inside the plugins folder in vuetify.js file. It's a better approach as there you can also change the theme colors if you'll like to. Inside the vuetify.js file, you can do import Vuetify from 'vuetify/lib'; – BeaST 30 Jun 01 '20 at 08:59
1

the issue because dependency was not found. do following and reload the project will fix the issue

npm install --save vuetify/lib/framework

Solved Issue

Mohamed Raza
  • 818
  • 7
  • 24