Reputation: 101
While installing vuetify through vue add vuetify gives error .not sure what is this.Please find the error below : Error: Cannot find module '../presets/undefined'
Upvotes: 0
Views: 4041
Reputation: 1391
I met the similar error when adding vuetify to my existing vue app. The webpack install guide works for me.
Note: I am new in Vue and Vuetify. Please let me know if I did something wrong in the following steps.
Here are some highlights:
$ npm install vuetify
plugins/vuetify.js
:import Vue from 'vue'
import Vuetify from 'vuetify'
import 'vuetify/dist/vuetify.min.css'
Vue.use(Vuetify)
const opts = { /* your vuetify options*/ }
export default new Vuetify(opts)
For webpack, you may also need to add some additional packages and add a extra config section in webpack.config.js
(see the webpack install guide). If you are using parcel then you can skip this step.
Use it in your entrypoint e.g. main.js
import Vue from 'vue'
import App from './App.vue'
import vuetify from './plugins/vuetify' // path to vuetify export
new Vue({
el: '#app',
vuetify,
render: h => h(App)
})
Set up your Vuetify <v-app>
in App.vue
:
<template>
<v-app>
<v-main>
<v-container>
<v-card :elevation="2" class="mx-auto pa-6">
<h1>Hello Vuetify from <code>{{ name }}</code></h1>
</v-card>
</v-container>
</v-main>
</v-app>
</template>
<script>
const App = {
data: function() {
return {
name: 'App'
}
}
}
export default App
</script>
Upvotes: 2