Does not provide an export named 'routes' on fresh install of vue #427
-
I had this issue on an existing project. So decided to try on a fresh install of vue with npm create vue@latest. I added vue router and then replaced the router as per the docs with import { createRouter, createWebHistory } from 'vue-router/auto'
import { routes } from 'vue-router/auto-routes' "unplugin-vue-router": "^0.10.0",
"vue": "^3.4.29",
"vue-router": "^4.4.0" But I get the same error:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I was missing the vite config. I hadnt seen the documentation link at the bottom of the readme page in github. VueRouter({
logs: true,
routesFolder: [
{
src: 'src/pages',
},
],
}), After this I ran dev again and I see it created the routes and everything works fine now. |
Beta Was this translation helpful? Give feedback.
I was missing the vite config.
I hadnt seen the documentation link at the bottom of the readme page in github.
After this I ran dev again and I see it created the routes and everything works fine now.