Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

changed handle_error and index segments #962

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions runtime/src/app/app.ts
Expand Up @@ -145,7 +145,7 @@ export function handle_error(url: URL) {
},
component: ErrorComponent
},
segments: preloaded
segments: ['_error']

}
const query = extract_query(search);
Expand Down Expand Up @@ -274,7 +274,8 @@ export async function hydrate_target(target: Target): Promise<{
branch?: Array<{ Component: ComponentConstructor, preload: (page) => Promise<any>, segment: string }>;
}> {
const { route, page } = target;
const segments = page.path.split('/').filter(Boolean);
const segments = page.path === '/' ? ['index'] : page.path.split('/').filter(Boolean);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi! I would also like to have this feature/fix.
So, this change will not allow us to have a route like index? Why not just pass the empty string '' instead? It's basically what we have in url.



let redirect: Redirect = null;

Expand Down