Code: Select all
npm run build
Code: Select all
app/checkout/[uuid]/page.tsx
Type error: Type '{ params: { uuid: string; }; }' does not satisfy the constraint 'PageProps'.
Types of property 'params' are incompatible.
Type '{ uuid: string; }' is missing the following properties from type 'Promise': then, catch, finally, [Symbol.toStringTag]
Static worker exited with code: 1 and signal: null
Code: Select all
import CheckoutForm from "@/components/forms/checkout-form";
import { notFound, redirect } from "next/navigation";
import { prisma } from "@/lib/db";
import { Progress } from "@/components/ui/progress";
async function getCheckoutData(uuid: string) {
const checkoutData = await prisma.checkout.findUnique({
where: { id: uuid },
select: {
id: true,
title: true,
status: true,
currency: true,
},
});
if (!checkoutData) {
notFound();
}
return checkoutData;
}
export default async function CheckoutPage({ params }: { params: { uuid: string } }) {
const checkoutData = await getCheckoutData(params.uuid);
if (checkoutData.status === true) {
redirect('/');
}
return (
{checkoutData.title}
Clears instantly 24/7
);
}
Code: Select all
const { uuid } = await Promise.resolve(params);