-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Labels
Description
Describe the bug
The resolved types of page.url.pathname
from the $app/state
rune inside a layout group include the group name, however the group name is not part of the URL.
This bug was probably introduced with SvelteKit 2.26 and this PR
Example file structure:
src/routes/
│ (group)/
│ ├ path-a/
│ └ +layout.svelte
Expected type: "/path-a"
Resolved type: "/(group)/path-a"
Reproduction
Here's a repo reproducing this issue: https://github.com/peppasd/svelte-typed-pathname-groups-repro
By opening the file src/routes/(main)/+layout.svelte
typescript will show the following error:

Logs
System Info
System:
OS: macOS 15.5
CPU: (11) arm64 Apple M3 Pro
Memory: 107.28 MB / 18.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 24.1.0 - ~/.nvm/versions/node/v24.1.0/bin/node
npm: 11.3.0 - ~/.nvm/versions/node/v24.1.0/bin/npm
bun: 1.2.19 - /opt/homebrew/bin/bun
Browsers:
Chrome: 138.0.7204.158
Safari: 18.5
npmPackages:
@sveltejs/adapter-auto: ^6.0.0 => 6.0.1
@sveltejs/kit: ^2.22.0 => 2.26.0
@sveltejs/vite-plugin-svelte: ^6.0.0 => 6.1.0
svelte: ^5.0.0 => 5.36.16
vite: ^7.0.4 => 7.0.6
Severity
annoyance
Additional Information
No response
PatrickG, saturnonearth and ncvc