Skip to content

Setting initial route fails when routes have dynamic import #130

Closed
@ChristophWalter

Description

@ChristophWalter

Describe the bug
There is a test which shows that initialising a router can be done by pushing a path. We use dynamic imports to lazy load our routes. In combination, this results that the initial route is not set at all.

const {queryByTestId} = render(App, {routes}, (vue, store, router) => {
router.push('/about')
})

To Reproduce
Change the following line to

{path: '/about', component: () => import('./components/Router/About.vue')},

and run the tests.

{path: '/about', component: About},

Expected behavior
I expected that to work right out of the box or with help of waitFor or something... But I did not manage to get it working.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions