amsik / liquor-tree

Tree component based on Vue.js
MIT License
398 stars 95 forks source link

window.Vue.use is not a function after upgrade to Laravel-mix 6 #232

Open jago86 opened 3 years ago

jago86 commented 3 years ago

Hi, I was working with laravel-mix 5 and all was working fine. However, when i update to laravel-mix 6, apparently the compilations works fine, but in the browser I have this error message:

Uncaught TypeError: window.Vue.use is not a function
    js http://localhost:8080//company-assets/js/my-hvs/index.js:19289
    __webpack_require__ http://localhost:8080//company-assets/js/my-hvs/index.js:79599
    fn http://localhost:8080//company-assets/js/my-hvs/index.js:79826
    ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5[0].rules[0].use[0]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/assets/companies/js/components/Hv/HvsTree.vue?vue&type=script&lang=js& http://localhost:8080//company-assets/js/my-hvs/index.js:2776
    __webpack_require__ http://localhost:8080//company-assets/js/my-hvs/index.js:79599
    fn http://localhost:8080//company-assets/js/my-hvs/index.js:79826
    ./resources/assets/companies/js/components/Hv/HvsTree.vue?vue&type=script&lang=js& http://localhost:8080//company-assets/js/my-hvs/index.js:64103
    __webpack_require__ http://localhost:8080//company-assets/js/my-hvs/index.js:79599
    fn http://localhost:8080//company-assets/js/my-hvs/index.js:79826
    vue http://localhost:8080//company-assets/js/my-hvs/index.js:63833
    __webpack_require__ http://localhost:8080//company-assets/js/my-hvs/index.js:79599
    fn http://localhost:8080//company-assets/js/my-hvs/index.js:79826
    js http://localhost:8080//company-assets/js/my-hvs/index.js:3453
    __webpack_require__ http://localhost:8080//company-assets/js/my-hvs/index.js:79599
    <anonymous> http://localhost:8080//company-assets/js/my-hvs/index.js:80745
    <anonymous>

Have no idea what is happening, but I guess it's related to some file in liquor-tree that uses window.Vue.use without import Vue first. Before it seems that laravel-mix doesn't matter, you just have to put Vue in a window.Vue variable, but now is mandatory to use import Vue from 'vue'

There's some workaround for these issue?

parth-ka-patel commented 1 year ago

I am facing same issue if any one have solution please help me to figure out this issue.