Skip to content

How to use it in Astro project (The requested module 'vue-router/auto-routes' does not provide an export named 'routes') #658

@kathirr007

Description

@kathirr007

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 [unplugin-vue-router](https://github.com/posva/unplugin-vue-router) to generate routes automatically with files structure, I'm getting the below error:

[ERROR] [vite] The requested module 'vue-router/auto-routes' does not provide an export named 'routes'

Image

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:
https://github.com/kathirr007/astro-vue-spa-starter

If I'm not using the auto generated routes, but manually created routes like below vue-router works fine:

Image

Note:

It works fine with manual routes array.
Same configuration works fine in normal vue app.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions