This repository contains a minimal reproduction of a bug in SvelteKit related to error handling when using multiple rest parameters in route definitions.
Routes
[...prefix]/[event=eventSlug]/[id]/overview/+page.svelte
[...prefix]/[event=eventSlug]/[id]/details/+page.svelte
...
[...prefix]/[event=eventSlug]/[id]/[...rest]/+page.ts -> throw 404
[...prefix]/[event=eventSlug]/[id]/+error.svelte -> never called
When a request is made to a route that does not match any of the defined subpaths of /event/:id (e.g., /some/long/prefix/event|project/:id/invalid-path), the /event/:id/+error.svelte component should be rendered, displaying a 404 error page.
Instead of rendering the nested +error.svelte component, SvelteKit renders the top-most +error.svelte component, which is not what I would expect.
[...prefix] part of the route.event instead of [event=eventSlug]).