question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

You need to call Vue.use(VueRouter) before this plugin!

See original GitHub issue
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!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
egoistcommented, Jan 23, 2019

Fixed in 1.1.2

1reaction
egoistcommented, Jan 23, 2019

hmm maybe a codesandbox bug, tried it on stackblitz and it’s working fine https://stackblitz.com/edit/js-c7khqh

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uncaught Error: [vue-composition-api] must call Vue.use ...
You need to Vue.use(CompositionApi) before trying to use anything that belongs to @vue/composition-api . In your main.js ...
Read more >
dev mode, mixin in sfc is merged before vue-router plugin install
First you should run Vue.use(VueRouter) before import/require your sfc. I find several workarounds for now: use commonjs to require .vue ...
Read more >
Navigation Guards | Vue Router
You can register global before guards using router. ... In that case, you must call next exactly once in any given pass through...
Read more >
How to Use Vue Router: A Complete Tutorial - Vue School Blog
We will go over everything you need to know to use Vue Router comfortably. We will cover: Vue Router Fundamentals; Dynamic routing; How...
Read more >
Yes, this is how vue-router guards work & when to use them
BUT! It has guards, that we can also call hooks, where you can plug onto. Vue Router has 3 types of guards: Global...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found