mirror of
https://github.com/vercel/commerce.git
synced 2025-06-09 01:36:57 +00:00
return 404 for invalid page
This commit is contained in:
parent
64677c2fe9
commit
ef5298664c
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user