You need to call Vue.use(VueRouter) before this plugin!
octoxan opened this issue · 5 comments
octoxan commented
import Vue from 'vue';
import router from './routes';
import store from "./store";
import VueRouter from 'vue-router';
Vue.use(VueRouter);
import RouterPrefetch from 'vue-router-prefetch';
Vue.use(RouterPrefetch);
This throws the error You need to call Vue.use(VueRouter) before this plugin!
octoxan commented
__WEBPACK_IMPORTED_MODULE_0_vue___default.a.use(__WEBPACK_IMPORTED_MODULE_7_vue_router__["a" /* default */]);
__WEBPACK_IMPORTED_MODULE_0_vue___default.a.use(__WEBPACK_IMPORTED_MODULE_8_vue_router_prefetch__["a" /* default */]);
I see it compiled out to this
egoist commented
Please create a repro on codesandbox.io and paste it here
octoxan commented
Please create a repro on codesandbox.io and paste it here
https://codesandbox.io/s/n445jmw8np
This throws a different error though. Is that importing it wrong?
egoist commented
hmm maybe a codesandbox bug, tried it on stackblitz and it's working fine https://stackblitz.com/edit/js-c7khqh
egoist commented
Fixed in 1.1.2