title: Vue router with Vue 3 raises the error "Uncaught TypeError: Object(...) is not a function"
body: <p>Created a simple Vue project using the CLI:</p>
  <pre><code>vue create my-project
  </code></pre>
  <p>Wanted to add two pages, so installed the latest version of vue-router (which is currently v3.4.8) and followed the <a href="https://www.vuemastery.com/blog/vue-router-a-tutorial-for-vue-3/" rel="nofollow noreferrer">vue mastery tutorial for routing</a>.</p>
  <p>This is what my router.js file looks like:</p>
  <pre><code>import { createWebHistory, createRouter } from 'vue-router'
  import Home from './components/Home.vue'
  import About from './components/About.vue'
  
  const router = createRouter({
    history: createWebHistory(),
    routes: [
      { path: '/', name: 'Home', component: Home },
      { path: '/about', name: 'About', component: About },
    ]
  })
  
  export default router
  
  </code></pre>
  <p>And of course, this is what my main.js file looks like:</p>
  <pre><code>import { createApp } from 'vue'
  import router from './router'
  
  createApp({
    template: `
    &lt;div&gt;
      &lt;router-link to='/'&gt;Home&lt;/router-link&gt;
      &lt;router-link to='/create'&gt;Create&lt;/router-link&gt;
    &lt;/div&gt;
    `
  })
  .use(router)
  .mount('#app')
  </code></pre>
  <p>Both of the Home and About components don't really have much in them, this is what they look like:</p>
  <pre><code>&lt;template&gt;
    &lt;div&gt;TODO: Home&lt;/div&gt;
  &lt;/template&gt;
  
  &lt;script&gt;
    export default {
      name: 'Home'
    }
  &lt;/script&gt;
  </code></pre>
  <p>Anyway, all of this to say that I am getting the following error on:</p>
  <blockquote>
  <p>Uncaught TypeError: Object(...) is not a function</p>
  <p>at eval (router.js?41cb:5)</p>
  </blockquote>
  <p>This is specifically on <code>createRouter</code></p>
  <p>Have I done something wrong?</p>
  <p>Edit: as Boussadjra Brahim pointed out, originally <code>createWebHistory</code> was just being passed in without being a function call. I've since updated the code to include this.</p>
  <p>Interestingly enough, once that was done, the error is not happening upon it's call.</p>