How to use it in Astro project (The requested module 'vue-router/auto-routes' does not provide an export named 'routes') #660
-
Hi, I am trying to create a starter project with Astro which includes Vue and React integrations. I am able to integrate and use React and Vue components without any issue. Then I was trying to use Vue router as in normal Vue SPA it works fine with manual routes generation with router object and normal configuration. But when I was trying to use [ERROR] [vite] The requested module 'vue-router/auto-routes' does not provide an export named 'routes' Actually as you can see in the screenshot the routes are generated and all the type declarations also generated. Have anyone tried to use it in Astro project? Please help me to fix the issue. Here is the reproduction repository: If I'm not using the auto generated routes, but manually created routes like below vue-router works fine: Note:It works fine with manual routes array. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
This is what showing in the browser. |
Beta Was this translation helpful? Give feedback.
-
Fixed it by updating No change in Instead of importing name import |
Beta Was this translation helpful? Give feedback.
Fixed it by updating
main.ts
like below:No change in
astro.config.mjs
Instead of importing name import
routes
fromvue-router/auto-routes
, I've imported all of them as universal import.