Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Router.go should find a route based on its defined path relative to the base href #802

Open
nweldev opened this issue Sep 2, 2022 · 0 comments

Comments

@nweldev
Copy link

nweldev commented Sep 2, 2022

Description of the bug

When using a <base href> element, router.baseURL correctly retrieves the right value.
However, when trying to call Router.go(relativePath), no route is found.
Calling Router.go(document.querySelector('base')?.href + relativePath) does work as a workaround.

Minimal reproducible example

See blindnet-io/privacy-components-web#84

Expected behaviour

When defining the following route:

{ path: '/myroute', component: 'app-my-component' }

And a base href:

<base href="/my/subdir/`>

Calling Router.go('/myroute') should find and load the associated route.

Actual behavior

Only Router.go('/my/subdir/myroute') works (adding the base href manually).

Versions:

  • Vaadin / Hilla version: @vaadin/router@1.7.4
  • Node version: v16.14.0
  • Java version: None
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant