mefechoel / svelte-navigator

Simple, accessible routing for Svelte
Other
506 stars 39 forks source link

Nested routes not working as expected when router basepath is set #108

Open lionzeye opened 1 year ago

lionzeye commented 1 year ago

Problem: nested routes work as expected when a basepath is set to the Router and navigation is done from a root Route. However, if I trigger a full page reload and try to let the Router pick up a nested Route from the current URL, then no Route content is displayed and the Router doesn't fall back to any other Route in the expected fallback order.

<Router basepath="/host">
    <Link to="svelte">Go to Svelte</Link>
    <Link to="test/1234">Go to test with id 1234</Link>
    <Route path="svelte">Yeah, Svelte!</Route>
    <Route path="test/:id" let:params>at: {params.id}</Route>
    <Route>404</Route>
</Router>

Expected content after full page reload: image

Actual content after page reload: image

Tested version: 3.2.2