The problem was on getStaticPaths function, instead of passing the id, I passed the object
export async function getStaticPaths() {
const productsIds = await prisma.product.findMany();
return {
paths: productsIds.map((id) => ({
params: { id: id.toString() },
})),
fallback: true, // false or "blocking"
};
The correction:
export async function getStaticPaths() {
const productsIds = await prisma.product.findMany({
select: {id: true},
});
return {
paths: productsIds.map((product) => ({
params: { id: product.id.toString() },
})),
fallback: 'blocking', // false or "blocking"
};
}