mefechoel / svelte-navigator

Simple, accessible routing for Svelte

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Nested routes not working as expected when router basepath is set

lionzeye opened this issue · comments

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