Vuejs - Uncaught TypeError: Cannot redefine property: $router


In my index.html file, I had imported vue again:

<!DOCTYPE html>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <title>Meko Deng</title>
    <div id="app"></div>
    <!-- <script src="[email protected]/dist/vue.js"></script> -->

Commenting that out did the trick!

This is due to the following code in vue-router

if (inBrowser && window.Vue) {

which is really only present for when you're including files in <script> blocks (ie, no build system).

Remove any <script> elements relating to Vue or related components; you don't need them when using Webpack.