Skip to content

Clashing endpoint-powered pages break route sorting #4038

@mrkishi

Description

@mrkishi

Describe the bug

When multiple endpoint-powered pages have a clashing route path, both client- and server-side routers break, not following sorting rules.

Given:

/[id].js
/[id].svelte
/[slug].js
/[slug].svelte

A client-side navigation to any matching route renders [id].svelte with undefined props, without hitting the endpoint.

A full-page navigation does hit the endpoints and falls through them, but you get back their JSON payload instead of the rendered page.

Reproduction

Minimal reproduction available here.

Logs

No response

System Info

System:
    OS: Windows 10 10.0.19044
    CPU: (4) x64 Intel(R) Core(TM) i5-3570 CPU @ 3.40GHz
    Memory: 1.44 GB / 7.88 GB
  Binaries:
    Node: 17.5.0 - ~\scoop\apps\nodejs\current\node.EXE
    npm: 8.4.0 - ~\scoop\apps\nodejs\current\bin\npm.CMD
  Browsers:
    Chrome: 98.0.4758.102
    Edge: Spartan (44.19041.1266.0), Chromium (98.0.1108.56)
  npmPackages:
    @sveltejs/adapter-auto: next => 1.0.0-next.17
    @sveltejs/kit: next => 1.0.0-next.279
    svelte: ^3.44.0 => 3.46.4

Severity

serious, but I can work around it

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions