You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi everyone,
Honestly I'm not quite sure where to start, I've hit a use case where the routing isn't quite working how I think it should be working, so I would very tentatively call it a bug.
Scenario
The page I'm concerned about is at the path event/:id and below.
There can be any number of previous path segments before hand, thus I added a [...path] before.
The "event" string could actually be multiple different strings, event | project | job, so i have a param matcher for that
The id being a slug is quite self explanatory
Then the main page of the event is actually under event/:id/overview, so I've got that redirect in event/[id]/+page.ts
Now if a path like event/:id/invalid gets hit, I want to display an error inside of the event page, so event/[id]/+error.svelte, thus the event/:id/[...catchall]/+page.ts.
Entire Structure:
Expected Behaviour
Sveltekit hits the event/:id/[...catchall]/+page.ts, throws the 404 that gets caught in the event/[id]/+error.svelte.
Actual Behaviour
The entire route gets 404-ed and the generic 404 message gets displayed.
Now it does actually work as expected, if either one of these modifications is made:
/[id]/ -> /1/ : If the id is not a slug, but a literal 1 (for example to match the hrefs), it does work correctly (the red outline around the 404 message shows that it's the correct +error.svelte
/[event=eventSlug]/ -> /event/ : If the event segment does not have a param matcher, it also works correctly
Addendum
I also think I experienced more weirdness, where the routing wouldn't behave the same when built on windows compare to linux, where on my local windows machine it would work as expected and on linux rest parameters would get hit instead of other explicit paths on the same level, but I haven't really been able to reproduce that so far.
Describe the bug
Hi everyone,
Honestly I'm not quite sure where to start, I've hit a use case where the routing isn't quite working how I think it should be working, so I would very tentatively call it a bug.
Scenario
The page I'm concerned about is at the path
event/:id
and below.[...path]
before.event | project | job
, so i have a param matcher for thatid
being a slug is quite self explanatoryevent
is actually underevent/:id/overview
, so I've got that redirect inevent/[id]/+page.ts
event/:id/invalid
gets hit, I want to display an error inside of the event page, soevent/[id]/+error.svelte
, thus theevent/:id/[...catchall]/+page.ts
.Entire Structure:
Expected Behaviour
Sveltekit hits the
event/:id/[...catchall]/+page.ts
, throws the 404 that gets caught in theevent/[id]/+error.svelte
.Actual Behaviour
The entire route gets 404-ed and the generic 404 message gets displayed.
Now it does actually work as expected, if either one of these modifications is made:
/[id]/ -> /1/
: If theid
is not a slug, but a literal1
(for example to match the hrefs), it does work correctly (the red outline around the 404 message shows that it's the correct+error.svelte
/[event=eventSlug]/ -> /event/
: If theevent
segment does not have a param matcher, it also works correctlyAddendum
I also think I experienced more weirdness, where the routing wouldn't behave the same when built on windows compare to linux, where on my local windows machine it would work as expected and on linux rest parameters would get hit instead of other explicit paths on the same level, but I haven't really been able to reproduce that so far.
Reproduction
https://stackblitz.com/edit/sveltejs-kit-template-default-win19u?file=src%2Fparams%2FidParam.ts
Logs
No response
System Info
Severity
blocking all usage of SvelteKit
Additional Information
No response
The text was updated successfully, but these errors were encountered: