title: Vue-router error: TypeError: Cannot read property 'matched' of undefined
body: <p>I'm trying to write my first Vuejs app. I'm using <code>vue-cli</code> and <a href="https://github.com/vuejs-templates/webpack-simple" rel="noreferrer">simple-webpack boilerplate</a>.</p>
  
  <p>When I add <code>vue-router</code> links to my app component I get this error in console</p>
  
  <blockquote>
    <p>Error in render function: "TypeError: Cannot read property 'matched' of undefined"</p>
  </blockquote>
  
  <p>Here is my code:</p>
  
  <p><strong>App.vue</strong></p>
  
  <pre><code>&lt;template&gt;
    &lt;div&gt;
      &lt;h2&gt;Links&lt;/h2&gt;
      &lt;ul&gt;
        &lt;router-link to='/'&gt;Home&lt;/router-link&gt;
        &lt;router-link to='/query'&gt;Query&lt;/router-link&gt;
  
        &lt;router-view&gt;&lt;/router-view&gt;
      &lt;/ul&gt;
    &lt;/div&gt;
  &lt;/template&gt;
  
  &lt;script&gt;
      export default {}
  &lt;/script&gt;
  </code></pre>
  
  <p><strong>main.js</strong></p>
  
  <pre><code>import Vue from 'vue'
  import VueRouter from 'vue-router'
  
  Vue.use(VueRouter)
  import routes from './routes.js'
  import App from './App.vue'
  
  const app = new Vue({
    el: '#app',
    routes,
    render: h =&gt; h(App)
  })
  </code></pre>
  
  <p><strong>routes.js</strong></p>
  
  <pre><code>import VueRouter from 'vue-router';
  let routes=[
    {
      path: '/',
      component: require('./Components/Home.vue')
    },
    {
      path: '/query',
      component: require('./Components/Query.vue')
    }
  ];
  
  export default new VueRouter({routes});
  </code></pre>