diff --git a/pages/product/[slug].tsx b/pages/product/[slug].tsx index a063e9c88..1342968a5 100644 --- a/pages/product/[slug].tsx +++ b/pages/product/[slug].tsx @@ -37,10 +37,11 @@ export async function getStaticPaths() { const { products } = await getAllProductPaths() return { - // paths: products.map((product) => ({ - // params: { slug: product!.node.path.trim() }, - // })), - paths: [], + paths: products.map((product) => { + const { path } = product!.node + // Exclude the slashes: `/slug/` -> `slug` + return { params: { slug: path.substring(1, path.length - 1) } } + }), fallback: 'unstable_blocking', } }