Skip to content

Default behaviour of trailingSlash violated #11317

@mledl

Description

@mledl

Describe the bug

SvelteKit will remove trailing slashes from URLs by default according to the docs. This functionality is not fully provided anymore since #10763 got merged.

Using the default value for paths.base the trailing slash will be added to any sub route like /home/foo/. However, this trailing slash will be removed after reloading the page. Moreover, in case of the default value for paths.base there is no trailing slash at root.

I would expect that the default behaviour of trailingSlash page option is still valid for default paths.base even after merging #10763.

Reproduction

A minimal repro example of the issue can be found in this repo.

Logs

No response

System Info

System:
    OS: Windows 11 10.0.22621
    CPU: (16) x64 11th Gen Intel(R) Core(TM) i7-11850H @ 2.50GHz
    Memory: 16.05 GB / 31.73 GB
  Binaries:
    Node: 20.9.0 - ~\AppData\Local\Volta\tools\image\node\20.9.0\node.EXE
    Yarn: 1.22.18 - ~\AppData\Local\Volta\tools\image\yarn\1.22.18\bin\yarn.CMD
    npm: 10.1.0 - ~\AppData\Local\Volta\tools\image\npm\10.1.0\bin\npm.CMD
    pnpm: 8.4.0 - ~\AppData\Local\Volta\bin\pnpm.EXE
  Browsers:
    Edge: Chromium (120.0.2210.61)
    Internet Explorer: 11.0.22621.1
  npmPackages:
    @sveltejs/adapter-node: ^1.3.1 => 1.3.1 
    @sveltejs/kit: ^1.30.3 => 1.30.3 
    svelte: ^4.2.2 => 4.2.8 
    vite: ^4.5.0 => 4.5.1

Severity

serious, but I can work around it

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions