Incremental build failed, new content (page) throw 404 #16105
Answered
by
timneutkens
yudyananda
asked this question in
Help
-
Hi, i have i have dynamic pages // [slug].js
const ProductPage = ({product}) => {
const router = useRouter()
return(
<Layout>
<SingleProductBlock product={product} />
</Layout>
)
}
export const getStaticProps = async ({params}) => {
const id = params.slug
const result = await client.query({
query: PRODUCT_BY_SLUG_QUERY,
variables: { id }
})
return {
props: {
product: result.data.product
},
revalidate: 10
};
}
export async function getStaticPaths() {
const allProducts = await client.query({
query: PRODUCTS_HOMEPAGE,
})
const paths = allProducts.data.products.edges.map((product) => ({
params: {
slug: product.node.slug
},
}))
return {
paths,
fallback: false
}
}
export default ProductPage my question is should i rebuild the entire content everytime i add new one for the above page? if i have not mistaken the incremental build in next.js should add new page (on the fly) without me have to rebuild from the start. If it's correct then why every link that leads to the new page throw me to the 404? |
Beta Was this translation helpful? Give feedback.
Answered by
timneutkens
Aug 12, 2020
Replies: 1 comment 1 reply
-
You're not using |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
yudyananda
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You're not using
fallback: true
, which handles newly added pages: https://nextjs.org/docs/basic-features/data-fetching#fallback-true