Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vue 3, Uncaught TypeError: Vue.use is not a function

I am trying to upgrade the Laravel project's frontend into Vue 3 from vue 2. During the process, I faced one issue

Uncaught TypeError: Vue.use is not a function

I don't know what the problem is, please help me if you have any ideas. Thanks.

like image 472
Yuanzhe Cui Avatar asked Oct 26 '25 15:10

Yuanzhe Cui


1 Answers

Vue.use is no longer supported in Vue3 as Vue is no longer a global instance. You have to add the plugins to the app:

const app = createApp(MyApp)
app.use(VueRouter)

As described here: https://v3-migration.vuejs.org/breaking-changes/global-api.html#a-note-for-plugin-authors

like image 199
Thomas Avatar answered Oct 29 '25 09:10

Thomas