Skip to content

Resolve problems with (group) folder #14062

@hawk93

Description

@hawk93

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

Stackblitz

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions