diff --git a/package.json b/package.json index b67eb18e1..9fcc3c1d2 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "@types/classnames": "^2.2.10", "classnames": "^2.2.6", "lodash": "^4.17.20", - "next": "^9.5.4-canary.20", + "next": "^9.5.4-canary.23", "postcss-nested": "^5.0.1", "postcss-nesting": "^7.0.1", "react": "^16.13.1", diff --git a/pages/product/[slug].tsx b/pages/product/[slug].tsx index f8fd880eb..1342968a5 100644 --- a/pages/product/[slug].tsx +++ b/pages/product/[slug].tsx @@ -37,9 +37,11 @@ export async function getStaticPaths() { const { products } = await getAllProductPaths() return { - paths: products.map((product) => ({ - params: { slug: product!.node.path }, - })), + 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', } } diff --git a/yarn.lock b/yarn.lock index 78957c6c2..858e9c246 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5039,7 +5039,7 @@ next-tick@~1.0.0: resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.0.0.tgz#ca86d1fe8828169b0120208e3dc8424b9db8342c" integrity sha1-yobR/ogoFpsBICCOPchCS524NCw= -next@^9.5.4-canary.20: +next@^9.5.4-canary.23: version "9.5.4-canary.23" resolved "https://registry.yarnpkg.com/next/-/next-9.5.4-canary.23.tgz#ce0e7b9e284b5f9b718610ff5363827d3dfecd44" integrity sha512-uNMIonQUZr5uZvmuMJ1Pq2akfzEQa60mQPVkMUUe12eHcE3efsA1M3W+SZfcSnSkCna53qU9Km1pNdGbVLe1Cg==