title: 'does not provide an export named 'createRouter'' vue 3, vite and vue-router
body: <p>I just started using vite with vue.</p>
  <p>When I'm trying to use vue-router I get the error:</p>
  <blockquote>
  <p>SyntaxError: The requested module '/node_modules/.vite/vue-router/dist/vue-router.esm.js?v=4830dca4' does not provide an export named 'createRouter</p>
  </blockquote>
  <p>My router/index.js looks like this:</p>
  <pre><code>import {
   createWebHistory,
   createRouter
  } from &quot;vue-router&quot;;
  
  import Services from &quot;../views/Services.vue&quot;;
  import Customers from &quot;../views/Customers.vue&quot;;
  
  const history = createWebHistory();
  const routes = [
    {
      path: &quot;/&quot;,
      component: Services
    },
    {
      path: &quot;/customers&quot;,
      component: Customers
    },
  ];
  const router = createRouter({
    history,
    routes
  });
  export default router;
  </code></pre>
  <p>My main.js looks like this:</p>
  <pre><code>import { createApp } from 'vue'
  import App from './App.vue'
  import './index.css'
  import router from './router'
  
  createApp(App).use(router).mount('#app')
  </code></pre>
  <p>My package.json looks like this:</p>
  <pre><code>{
   &quot;name&quot;: &quot;frontend&quot;,
   &quot;version&quot;: &quot;0.0.0&quot;,
   &quot;scripts&quot;: {
   &quot;dev&quot;: &quot;vite&quot;,
   &quot;build&quot;: &quot;vite build&quot;
  },
   &quot;dependencies&quot;: {
   &quot;vue&quot;: &quot;^3.0.5&quot;,
   &quot;vue-router&quot;: &quot;^3.4.9&quot;
  },
   &quot;devDependencies&quot;: {
   &quot;@vitejs/plugin-vue&quot;: &quot;^1.0.4&quot;,
   &quot;@vue/compiler-sfc&quot;: &quot;^3.0.5&quot;,
   &quot;autoprefixer&quot;: &quot;^10.2.3&quot;,
   &quot;postcss&quot;: &quot;^8.2.4&quot;,
   &quot;tailwindcss&quot;: &quot;^2.0.2&quot;,
   &quot;vite&quot;: &quot;^2.0.0-beta.12&quot;
   }
  }
  </code></pre>
  <p>Anyone knows how to export the route?</p>