mirror of
https://github.com/vercel/commerce.git
synced 2025-06-09 09:36:58 +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
|
const page = data?.page
|
||||||
|
|
||||||
if (!page) {
|
if (!page) {
|
||||||
// We throw to make sure this fails at build time as this is never expected to happen
|
return {
|
||||||
throw new Error(`Page with slug '${slug}' not found`)
|
notFound: true,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user