Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Errors while doing vue add vuetify(vue3 preview)

I tried to start a vue3 project with vuecli, but when I add vuetify, errors occurred while everything is normal when used vue2. It says

Error: You cannot call "get" on a collection with no paths. Instead, check the "length" property first to verify at least 1 path exists.

errorpicture

someone has the same problem, need some solution, thank you.

like image 843
K.Fasico Avatar asked Aug 23 '20 04:08

K.Fasico


People also ask

Does Vuetify work with vue3?

The current version of Vuetify does not support Vue 3.

Can I add Vuetify to existing project?

To include Vuetify into an existing project, you must install its npm package. You can use either npm or yarn to accomplish this task. These are both package managers that allow you to control what resources are available in your application.

Can you use Vuetify without Vue?

No, you can't run Vuetify without Vue. The reason is pretty simple, most of Vuetify is built with vue and most of those components require their script to run, so everything that's not entirely css based will not work.


Video Answer


3 Answers

In this link https://vuetifyjs.com/en/getting-started/installation/ Vuetify says:

The current version of Vuetify does not support Vue 3. Support for Vue 3 will come with the release of Vuetify v3. When creating a new project, please ensure you selected Vue 2 from the Vue CLI prompts, or that you are installing to an existing Vue 2 project.

like image 104
Marcelo Vinicius Avatar answered Oct 22 '22 15:10

Marcelo Vinicius


Add the following to main.js. It would solve the problem

new Vue({
    router,
    store,
    vuetify,
    render: h => h(App)
}).$mount("#app");
like image 5
user14417178 Avatar answered Oct 22 '22 15:10

user14417178


vue3 is giving this error because vue3 is in beta version if you use vue2 you solve your problem. My error is solved by this solution.

like image 2
Muhammad Abdullah Avatar answered Oct 22 '22 16:10

Muhammad Abdullah