0

I have a project working with Vue.js for a long time. Recently an error appeared without me doing anything:

Uncaught TypeError: window.Vue.use is not a function
    at eval (vue-router.esm.js?8c4f:2926:1)
    at Module../node_modules/vue-router/dist/vue-router.esm.js (chunk-vendors.js:5601:1)
    at __webpack_require__ (app.js:854:30)
    at fn (app.js:151:20)
    at eval (index.js:7:68)
    at Module../src/router/index.js (app.js:1414:1)
    at __webpack_require__ (app.js:854:30)
    at fn (app.js:151:20)
    at eval (main.js:15:65)
    at Module../src/main.js (app.js:1390:1)

this is my main.js code in Vue CLI 4.5.13 vesion :

import Vue from 'vue'
import BootstrapVue from 'bootstrap-vue'
import store from './store'

import App from './App.vue'
import './registerServiceWorker'
import router from './router'
import '@fortawesome/fontawesome-free/css/all.css'
import '@fortawesome/fontawesome-free/js/all.js'
import 'es6-promise/auto'
import FirebaseApp from './firebase'

import './assets/css/main.scss'

Vue.use(BootstrapVue)
Vue.use(FirebaseApp)
Vue.config.productionTip = false

/* Vue.use(VueClipboards) */

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')

Does anybody know how to solve this?

2
  • Look for a place where you used 'window.Vue' and replace it with the import Vue from 'vue' statement Commented Mar 28, 2022 at 21:18
  • @jeandavyNizigama Thanks dude, changing window.Vue = require('vue'); to import Vue from 'vue' fixed the issue for me. I'm using vue 2.7.16 and started having this issue since I did a massive yarn upgrade to vue and webpack. Commented Aug 8, 2024 at 15:44

1 Answer 1

0

Recently an error appeared without me doing anything:

Maybe you installed Vue@3 instead of [email protected]?

Sign up to request clarification or add additional context in comments.

1 Comment

this should be a comment, not an answer

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.