Geben Sie '{ uuid: string; }‘ fehlen die folgenden Eigenschaften vom Typ „Promise“
Posted: 16 Jan 2025, 10:38
Dies passiert aus bestimmten Gründen in meiner NextJS 15-App. Ich kann nicht herausfinden, was passiert. Die Entwicklungsumgebung funktioniert gut, aber wenn es um die Produktion geht:
Vollständiger Fehler:
page.tsx:
Ich habe versucht, Promise hinzuzufügen und Props zu definieren, nichts funktioniert.
Ty !
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);