-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Description
Describe the bug
I found a problem while using resolve with (group) folders in the path.
Given this directory structure
src/routes/[id]/
├ (group)/
│ ├ +page.svelte
│ └ in/
│ └ +page.svelte
└ out/
└ +page.svelte
You can resolve correctly "/a" calling resolve('/[id]', { id: 'a' })
or resolve('/[id]/(group)', { id: 'a' })
, but you can't resolve "/a/in" without a type error if you call resolve without the (group) folder, resolve('/[id]/in', { id: 'a' })
errors out (Expected 1 arguments, but got 2), while resolve('/[id]/(group)/in', { id: 'a' })
is fine
In the reproduction there are more variants of this directory structure with the usage of optional parameters too
Reproduction
Running the typecheck you see that it errors out when you pass params to the resolve function if you are trying to resolve the subfolder of a group
Logs
System Info
@sveltejs/kit: 2.26.1
svelte: 5.37.0
typescript: 5.8.3
Severity
annoyance
Additional Information
EDIT: Removed the second problem, I will open a separate issue for it