Geben Sie '{ uuid: string; }‘ fehlen die folgenden Eigenschaften vom Typ „PromiseJavaScript

Javascript-Forum
Guest
 Geben Sie '{ uuid: string; }‘ fehlen die folgenden Eigenschaften vom Typ „Promise

Post by Guest »

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:

Code: Select all

npm run build
Vollständiger Fehler:

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
page.tsx:

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

);
}

Ich habe versucht, Promise hinzuzufügen und Props zu definieren, nichts funktioniert.

Code: Select all

const { uuid } = await Promise.resolve(params);
Ty !

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post