Skip to content

Routing conflict not detected in nested groups #13704

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
philippone opened this issue Apr 13, 2025 · 1 comment
Open

Routing conflict not detected in nested groups #13704

philippone opened this issue Apr 13, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@philippone
Copy link

Describe the bug

I run into this issue by using the awesome vite-plugin-kit-routes. The issue describes the same problem but I guess Sveltekit should complain about conflicting routes to solve the issue.

I have the following route structure:

routes
└── (group)
    └── base
        ├── +page.svelte
        └── (optional-group)
            └── [[optionalParam]]
                └── +page.svelte

This generates the following routes

  • (group)/base
  • (group)/base/(optional-group)/[[optionalParam]]

(Un)Fortunately, the paths are actually resolving the correct page.svelte

  • /base -> (group)/base
  • /base/myparam -> (group)/base/(optional-group)/[[optionalParam]]

If I remove one of the groups, (group) or (optional-group), I got the following error message:

The "/base" and "/base/(optional-group)/[[optionalParam]]" routes conflict with each other

I guess the error should also appear when using the groups?

To use this route structure correctly

  • change [[optionalParam]] to [requiredParam]
  • remove the conflicting page (group)base/+page.ts

Reproduction

https://stackblitz.com/edit/sveltejs-kit-page-groupted-duplicate?file=README.md

Logs

System Info

System:
    OS: macOS 15.4
    CPU: (10) arm64 Apple M1 Max
    Memory: 511.97 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.12.0 - ~/.nvm/versions/node/v22.12.0/bin/node
    Yarn: 3.6.3 - ~/.nvm/versions/node/v22.12.0/bin/yarn
    npm: 10.9.0 - ~/.nvm/versions/node/v22.12.0/bin/npm
  Browsers:
    Chrome: 135.0.7049.85
    Safari: 18.4
  npmPackages:
    @sveltejs/kit: 2.20.4 => 2.20.4 
    @sveltejs/vite-plugin-svelte: 5.0.3 => 5.0.3 
    svelte: 5.25.7 => 5.25.7 
    vite: 6.2.5 => 6.2.5

Severity

annoyance

Additional Information

No response

@eltigerchino eltigerchino added the bug Something isn't working label Apr 15, 2025
@rChaoz
Copy link
Contributor

rChaoz commented Apr 15, 2025

I would expect there not to be an error at all, regardless of groups, instead the sorting rules should apply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants