Uncaught TypeError: Cannot read property 'install' of undefined
tarzanking opened this issue · comments
Describe the bug
I have error while import the vue-router-tab in my main js
Uncaught TypeError: Cannot read property 'install' of undefined
at Function.Vue.use (vue.runtime.esm.js?2b0e:5106)
at eval (main.js?56d7:98)
at Module../src/main.js (app.js:1802)
at __webpack_require__ (app.js:854)
at fn (app.js:151)
at Object.1 (app.js:2211)
at __webpack_require__ (app.js:854)
at checkDeferredModules (app.js:46)
at app.js:994
at app.js:997
To Reproduce
import RouterTab from 'vue-router-tab'
import 'vue-router-tab/dist/lib/vue-router-tab.css'
Vue.use(RouterTab);
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Development Environment (please complete the following information):
- Node.js: [v10.15.0]
- Vue: [v2.6.12]
- Vue Router [v3.4.9]
- Vue Router Tab [1.2.4]
Operating Environment (please complete the following information):
- Device: [Desktop]
- OS: [Windows 10]
- Browser [Chrome]
Check if the npm dependency of vue-router-tab has been installed?
import RouterTab from 'vue-router-tab'
import 'vue-router-tab/dist/lib/vue-router-tab.css'
console.log(RouterTab)
Vue.use(RouterTab);
Check if the npm dependency of vue-router-tab has been installed?
import RouterTab from 'vue-router-tab' import 'vue-router-tab/dist/lib/vue-router-tab.css' console.log(RouterTab) Vue.use(RouterTab);
console log It show undefined
and if I use
import * as RouterTab from 'vue-router-tab'
it show
Module {__esModule: true, Symbol(Symbol.toStringTag): "Module"}
Symbol(Symbol.toStringTag): "Module"
__esModule: true
__proto__: Object
I not sure how i fixed it
but after npm update
vue-router to "vue-router": "^3.5.1", and "@vue/cli-service": "^4.5.11",
it work for me now