diff --git a/packages/website/pages/[...slug].tsx b/packages/website/pages/[...slug].tsx index 61e3c8ab25..bc265dfb07 100644 --- a/packages/website/pages/[...slug].tsx +++ b/packages/website/pages/[...slug].tsx @@ -295,9 +295,12 @@ export const getStaticPaths: GetStaticPaths = async () => { ?.sectionCollection?.items[0]; } + const sectionSlug = section?.slug ?? 'default-section'; + const itemSlug = item?.slug ?? 'default-item'; const slug = item.authProtected - ? [section.slug, 'protected', item.slug] - : [section.slug, item.slug]; + ? [sectionSlug, 'protected', itemSlug] + : [sectionSlug, itemSlug]; + return { params: { slug,