-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Description
Describe the bug
When:
- Using adapter-static
- and setting
trailingSlash: 'always'inside the adapter settings in svelte.config.js - and using group layouts

And:
- running
npm run build
Then:
- route pages are still generated as
/a.htmlinstead of the expected/a/index.html.- Using the screenshot above, the build generates
privacy.htmlandterms.htmlinstead ofprivacy/index.htmlandterms/index.html
- Using the screenshot above, the build generates
This is confusing because the adapter-static docs say that this should work.
To fix, you must add export const trailingSlash = 'always'; inside each +layout.ts file.
Reproduction
- Create a sample sveltekit project
- Add some group layouts with pages inside
- Configure it to use adapter static and set
trailingSlash = 'always'in the adapter config is described here: https://kit.svelte.dev/docs/adapter-static#usage - Run
npm run build - Notice the generated output in the build folder is of the format a.html instead of /a/index.html
Logs
No response
System Info
System:
OS: Linux 5.19 KDE neon 5.27 5.27
CPU: (8) x64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
Memory: 3.44 GB / 15.38 GB
Container: Yes
Shell: 5.8 - /usr/bin/zsh
Binaries:
Node: 16.15.0 - ~/.nvm/versions/node/v16.15.0/bin/node
npm: 8.5.5 - ~/.nvm/versions/node/v16.15.0/bin/npm
Browsers:
Chrome: 114.0.5735.133
npmPackages:
@sveltejs/adapter-auto: ^2.0.0 => 2.1.0
@sveltejs/adapter-static: ^2.0.2 => 2.0.2
@sveltejs/kit: ^1.5.0 => 1.20.0
svelte: ^3.54.0 => 3.59.1
vite: ^4.3.0 => 4.3.9Severity
serious, but I can work around it
Additional Information
No response
Metadata
Metadata
Assignees
Labels
No labels