This project represents a small example that shows an issue with Sveltekits default behaviour regarding trailingSlash
introduced in Sveltekit version 1.30.1. The corresponding docs state that Sveltekit removes trailing Slashes by default which does not really work consistently anymore.
trailingSlash
not specifiedpaths.base
default value
- Clicking the Foo link on the root page will redirect to
http://localhost:5173/home/foo/
and the trailing shlash does not get removed. Reloading on this page will lead to removal of the trailing slash as followshttp://localhost:5173/home/foo
. This is some inconsistency since I would expect consistent behaviour accross reloads. - Having the trailing slash like
http://localhost:5173/home/foo/
will cause an issue when using a link where thehref
only specifies the child likehref="bar"
since it will try to navigate to the non existing routehttp://localhost:5173/home/foo/bar
. This feature works with Sveltekit removing trailing slashes