diff --git a/app/(home)/search/[collection]/page.js b/app/(home)/search/[collection]/page.js index f03932240..586ef3925 100644 --- a/app/(home)/search/[collection]/page.js +++ b/app/(home)/search/[collection]/page.js @@ -5,7 +5,13 @@ import { HomeProductsList } from '/components/home.js'; export async function generateStaticParams() { const collections = await getCollections(); - return collections.map(collection => ({ collection: collection.handle })); + const params = collections + .map(collection => ({ + collection: collection.handle, + })) + .filter(param => param.collection.length > 0); + + return params; } export default async function CollectionPage({ params: { collection } }) {