mirror of
https://github.com/vercel/commerce.git
synced 2025-07-23 04:36:49 +00:00
Bug Fix Round and Updates (#719)
* Kibo missing dependency * return 404 for invalid page * fix and simplify types for pages Co-authored-by: Dominik Sipowicz <dom@vercel.com>
This commit is contained in:
@@ -38,8 +38,9 @@ export async function getStaticProps({
|
||||
const page = data?.page
|
||||
|
||||
if (!page) {
|
||||
// We throw to make sure this fails at build time as this is never expected to happen
|
||||
throw new Error(`Page with slug '${slug}' not found`)
|
||||
return {
|
||||
notFound: true,
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
@@ -71,7 +72,7 @@ export async function getStaticPaths({ locales }: GetStaticPathsContext) {
|
||||
|
||||
export default function Pages({
|
||||
page,
|
||||
}: InferGetStaticPropsType<typeof getStaticProps>) {
|
||||
}: {page: Page}) {
|
||||
const router = useRouter()
|
||||
|
||||
return router.isFallback ? (
|
||||
|
Reference in New Issue
Block a user