Skip to content

Commit

Permalink
fix: crash when page not found & using multiVersion (#1007)
Browse files Browse the repository at this point in the history
Co-authored-by: Jakub Romanczyk <[email protected]>
  • Loading branch information
Timeless0911 and jbroma authored Apr 22, 2024
1 parent 3e5d442 commit f127348
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/core/src/runtime/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ export async function initPageData(routePath: string): Promise<PageData> {
const extractPageInfo = siteData.pages.find(page => {
const normalize = (p: string) =>
// compat the path that has no / suffix and ignore case
p
.replace(/\/$/, '')
.toLowerCase();
p.replace(/\/$/, '').toLowerCase();
return isEqualPath(normalize(page.routePath), normalize(routePath));
});

Expand Down Expand Up @@ -81,7 +79,7 @@ export async function initPageData(routePath: string): Promise<PageData> {
frontmatter: {},
title: '404',
toc: [],
version: '',
version: siteData.multiVersion.default || '',
_filepath: '',
_relativePath: '',
},
Expand Down

0 comments on commit f127348

Please sign in to comment.